by literal meaning, unistd.h is a UNIX-defined UNIX-class system-defined symbolic constant header file, which is meant by unix-based std.
Contains function prototypes for many UNIX system services, such as the Read function, the Write function, and the Getpid function.
Reference from HTTP://HI.BAIDU.COM/W_DALU/ITEM/E8D29860374AE02369105B11
Unistd.h is similar to the windows.h! in Windows in Unix
#ifdef WIN32
#include <windows.h>
#else
#include <unistd.h>
#endif
Unistd.h contains constants and functions:
ssize_t read (int, void *, size_t); Read File Usage
int unlink (const char *);
ssize_t write (int, const void *, size_t); Write a file
int Usleep (useconds_t); Process Hibernate, Unit is subtle
unsigned sleep (unsigned); Process hibernate, in seconds
int access (const char *, int); Get Permissions on files
Unsigned alarm (unsigned);
int chdir (const char *);
int chown (const char *, uid_t, gid_t);
int close (int); Close File
size_t confstr (int, char *, size_t);
void _exit (int);
pid_t fork (void);
NULL//NULL pointer
Seek_cur//Set file offset to current plus offset.
Seek_end//Set file offset to EOF plus offset.
Seek_set//SET file offset to offset.
Many of the C programs developed under Linux require header file Unistd.h, but there is no head file in VC,
So compile with VC always error. Save the following content as a unistd.h to solve this problem.
/** This file is the MINGW32 package.
* Unistd.h maps (roughly) to IO.h
*/
#ifndef _unistd_h
#define _unistd_h
#include <io.h>
#include <process.h>
#endif/* _unistd_h * *