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,...
Bryna asked 28/3, 2014 at 6:31

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...
Centesimo asked 18/5, 2016 at 4:18

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...
Dorweiler asked 6/8, 2022 at 9:55

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) ...
Lilt asked 26/11, 2012 at 15:54

2

Solved

Suppose two different processes open the same file independently, and so have different entries in the Open file table (system-wide). But they refer to the same i-node entry. As the file descriptor...
Martyr asked 11/1, 2022 at 18:26

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...
Varitype asked 21/12, 2015 at 16:45

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....
Nichellenichol asked 30/3, 2015 at 22:42

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 ...
Carven asked 17/3, 2012 at 11:29

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...
Clathrate asked 29/6, 2015 at 1:37

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 ...
Toluate asked 1/5, 2015 at 9:18

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...
Emrick asked 19/12, 2010 at 2:21

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...
Denson asked 26/9, 2012 at 7:40

1

Solved

I am trying to use pread and pwrite so that I can lseek to the beginning of the file and start reading or writing in one atomic operation. Both of these functions will do that for me however, the i...
Cagliari asked 13/9, 2012 at 17:47

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>...
Brogle asked 24/7, 2011 at 7:50
1

© 2022 - 2024 — McMap. All rights reserved.