[prev in list] [next in list] [prev in thread] [next in thread] 

List:       mingw-users
Subject:    [Mingw-users] Including library for unistd.h header
From:       Tor Lillqvist <tml () iki ! fi>
Date:       2005-09-28 23:26:59
Message-ID: 17211.9923.643000.1438 () gargle ! gargle ! HOWL
[Download RAW message or body]

Juan Jose Costello Levien writes:
 > I would like to know which .a file do I have to reference in order to build
 > a source that includes a reference to unistd.h.

You mean mingw's <unistd.h>, or the <unistd.h> on some Unix system?

Remember that mingw does not provide any more Unix APIs than what the
Microsoft C runtime provides. (Well, actually it does, but only a bit
more, no "difficult" things.) The Microsoft C runtime provides Unixish
functions like open(), read(), close(), but not functions like
getuid(), getegid(), getppid().

Mingw's <unistd.h> exists only to reduce the need for ifdefs in source
code ported to Windows. It includes the headers <io.h> and <process.h>
which are traditional headers provided by Windows C compilers, and
which declare *some* of the same functions that you would have in a
Unix <unistd.h>, but not all by a long shot. (The only function
declared in mingw's <unistd.h> itself is ftruncate().)

You don't need to specify any library (.a file) to get the functions
declared in mingw's <unistd.h> (i.e., <io.h> and <process.h>, they are
in the C runtime which is linked in by default.

--tml



-------------------------------------------------------
This SF.Net email is sponsored by:
Power Architecture Resource Center: Free content, downloads, discussions,
and more. http://solutions.newsforge.com/ibmarch.tmpl
_______________________________________________
MinGW-users mailing list
MinGW-users@lists.sourceforge.net

You may change your MinGW Account Options or unsubscribe at:
https://lists.sourceforge.net/lists/listinfo/mingw-users
[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic