LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Programming (https://www.linuxquestions.org/questions/programming-9/)
-   -   wat does <sys/types.h> mean? (https://www.linuxquestions.org/questions/programming-9/wat-does-sys-types-h-mean-368712/)

9488 10-01-2005 07:49 AM

wat does <sys/types.h> mean?
 
What does it mean?
#include <sys/types.h> is used to create file?

pid_t fork (void)
is it used to create a process?

CSIXTY4 10-01-2005 02:40 PM

#include is called a pre-processor directive. When you compile a C or C++ program, one of the first things it does is use a "pre-processor" to look for lines starting with # characters and take care of them. The #include directive inserts the contents of another file into that spot in the source code. Usually this is a "header" file (.h extension) that defines variable types or functions. Since the included file's name is surrounded by < and >, it means it's located in the standard include path, and not with the rest of the source files. If it were with the rest of the source files, there would be quotes around it (#include "types.h") instead. The "sys/" part means there's a "sys" directory where the standard header files are, and types.h can be found there.

fork() is used to spawn off a new process, yes. But I'd suggest getting a little more familiar with the rest of the language before you start messing with it.


All times are GMT -5. The time now is 01:50 PM.