unistd.h Questions
4
After having installed libpng into my computer, I've included it into my project using #include <png.h> on a Windows 7 SP1 plateform and using Visual Studio Ultimate 2013.
But at build time,...
2
Solved
I was trying to look up the prototype for the getpgrp() function in unistd.h but couldnt find it. The only line containing getpgrp in that file was the line libc_hidden_proto (tcgetpgrp) and I'm as...
1
I have written a C utility that may be launched manually or on a regular basis, by a cron rule. Inside the C program I want to know if it was launched by a cron rule or not.
Reading the user name w...
4
Solved
When including the sleep function from unistd.h the program hangs indefinitely:
#include <stdio.h>
#include <unistd.h>
int main()
{
int i;
printf("0 ");
for(i = 1; i <20; ++i)
...
2
Solved
10
Solved
I'm porting a relatively simple console program written for Unix to the Windows platform (Visual C++ 8.0). All the source files include "unistd.h", which doesn't exist. Removing it, I get...
Moribund asked 4/12, 2008 at 19:51
2
Solved
What is the difference between fsync and syncfs ?
int syncfs(int fd);
int fsync(int fd);
The manpage for fync says the following :
fsync() transfers ("flushes") all modified in-core data of (...
Hayseed asked 9/1, 2018 at 15:45
2
Solved
I am now trying to understand how read(2) function works by looking into the actual code implementation and first, I try to see how it is defined in #include header file.
In that file, I found thi...
Chanachance asked 30/8, 2019 at 13:56
1
Solved
As normal C++ execl works fine (compiling with g++ ok.cc -o ok.elf)
#include <unistd.h>
int main(){
execl("/usr/bin/python", "/usr/bin/python", nullptr);
}
But crashes, when works as node...
Somewhere asked 22/11, 2017 at 11:41
4
Solved
In my code I need to execute /bin/bash, but I wan't to do it without passing any arguments to it. I wrote this:
execl("/bin/bash", NULL);
Then, through some research, I realized that I a...
3
Solved
Using OS X 10.10.2, I download Clang for Mac OS X v. 3.6.0, and try to compile a simple Hello World program.
The commands I use are these:
(assumes you downloaded clang to .)
cd .
./clang+llvm-3....
3
Solved
I have come across this particular snippet of code many times in solutions of competitive programming contests. I understand the basic use of this code to beat time limits but i want to understand ...
1
Solved
I am getting the following warning when I compile:
execute.c:20:2: warning: implicit declaration of function ‘execvpe’[-Wimplicit-function-declaration] execvpe("ls", args, envp);
^
My understan...
1
Solved
When I have searched for the header unistd.h, in The Open Group, I found that it contains the standard symbolic constants & types and for sys/types.h it said for data types.
Then I found that ...
3
Solved
GNU unistd.h has this bit of magic:
/* Move FD's file position to OFFSET bytes from the
beginning of the file (if WHENCE is SEEK_SET),
the current position (if WHENCE is SEEK_CUR),
or the end o...
2
Solved
i have vlc (program to reproduce videos)
if i type in a shell:
/home/vlc "/home/my movies/the movie i want to see.mkv"
it opens up an reproduces the movie.
however, when I run the following prog...
1
Solved
3
Solved
I'm trying to use redirects in C to redirect input to one file and then set standard output back to print to the screen. Could someone tell me what's wrong with this code?
#include <stdio.h>...
1
© 2022 - 2024 — McMap. All rights reserved.