mirror of
https://github.com/adtools/clib2.git
synced 2025-12-08 14:59:05 +00:00
- Removed the various workarounds associated with <unistd.h>, required
for building code that references the networking API. It is now possible, provided you build your code with an existing TCP/IP API header file set (such as from the "Roadshow" SDK) without running into data type or function prototype declaration conflicts. I have added local versions of <arpa/inet.h>, <netinet/in.h>, <netdb.h>, <sys/filio.h>, <sys/ioccom.h>, <sys/ioctl.h>, <sys/select.h> and <sys/socket.h> and updated <unistd.h>, <pwd.h> and <grp.h> accordingly. Note that some of the function prototypes will conflict with the bsdsocket.library/usergroup.library API, which is why you can disable the declarations through the __NO_NET_API preprocessor symbol: if defined, none of the function prototypes will be defined. git-svn-id: file:///Users/olsen/Code/migration-svn-zu-git/logical-line-staging/clib2/trunk@15036 87f5fb63-7c3d-0410-a384-fd976d0f7a62
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* $Id: unistd.h,v 1.13 2005-07-12 13:35:58 obarthel Exp $
|
||||
* $Id: unistd.h,v 1.14 2005-10-09 12:32:18 obarthel Exp $
|
||||
*
|
||||
* :ts=4
|
||||
*
|
||||
@@ -40,16 +40,20 @@
|
||||
|
||||
/****************************************************************************/
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif /* __cplusplus */
|
||||
|
||||
/****************************************************************************/
|
||||
|
||||
#ifndef _FCNTL_H
|
||||
#include <fcntl.h>
|
||||
#endif /* _FCNTL_H */
|
||||
|
||||
#if !defined(__NO_NET_API) && !defined(_SYS_SELECT_H)
|
||||
#include <sys/select.h>
|
||||
#endif /* __NO_NET_API && _SYS_SELECT_H */
|
||||
|
||||
/****************************************************************************/
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif /* __cplusplus */
|
||||
|
||||
/****************************************************************************/
|
||||
|
||||
/* Endianness: we assume a big endian memory layout (for 68k and PowerPC). */
|
||||
@@ -118,11 +122,33 @@ extern char * __getcwd(char * buffer,size_t buffer_size,const char *file,int lin
|
||||
|
||||
/****************************************************************************/
|
||||
|
||||
/* If desired, also include the networking API, as integrated into
|
||||
the clib2 libnet.a library. */
|
||||
#if defined(__USE_CLIB2_NETLIB) && !defined(_SYS_CLIB2_NET_H)
|
||||
#include <sys/clib2_net.h>
|
||||
#endif /* __USE_CLIB2_NETLIB && !_SYS_CLIB2_NET_H */
|
||||
/*
|
||||
* The following prototypes may clash with the bsdsocket.library or
|
||||
* usergroup.library API definitions.
|
||||
*/
|
||||
|
||||
#ifndef __NO_NET_API
|
||||
|
||||
extern long gethostid(void);
|
||||
extern int gethostname(const char *name, size_t namelen);
|
||||
extern char *crypt(const char *key, const char *salt);
|
||||
extern gid_t getegid(void);
|
||||
extern uid_t geteuid(void);
|
||||
extern gid_t getgid(void);
|
||||
extern int getgroups(int gidsetsize, gid_t grouplist[]);
|
||||
extern char * getpass(const char *prompt);
|
||||
extern uid_t getuid(void);
|
||||
extern int initgroups(const char *name, gid_t basegid);
|
||||
extern int setegid(gid_t gid);
|
||||
extern int seteuid(uid_t uid);
|
||||
extern int setgid(gid_t gid);
|
||||
extern int setgroups(int ngroups, const gid_t *gidset);
|
||||
extern int setregid(gid_t rgid, gid_t egid);
|
||||
extern int setreuid(uid_t ruid, uid_t euid);
|
||||
extern pid_t setsid(void);
|
||||
extern int setuid(uid_t uid);
|
||||
|
||||
#endif /* __NO_NET_API */
|
||||
|
||||
/****************************************************************************/
|
||||
|
||||
|
||||
Reference in New Issue
Block a user