Files
2026-07-30 11:19:44 +05:30

194 lines
5.6 KiB
C

/*
******************************************************************************
* HEADER FILE
*
* Document no: @(#) $Name: VXWORKS_ITER40_2019102207 $ $RCSfile: unistd.h,v $ $Revision: 1.5.54.1 $
* $Source: /home/interpeak/CVSRoot/ipxinc/include/unistd.h,v $
* $Author: svc-cmnet $ $Date: 2017-09-05 23:33:09 $
* $State: Exp $ $Locker: $
*
* INTERPEAK_COPYRIGHT_STRING
* Design and implementation by Lennart Bang <lob@interpeak.se>
******************************************************************************
*/
#ifndef IP_UNISTD_H
#define IP_UNISTD_H
/*
****************************************************************************
* 1 DESCRIPTION
****************************************************************************
*/
/*
****************************************************************************
* 2 CONFIGURATION
****************************************************************************
*/
#include "ipcom_config.h"
/*
****************************************************************************
* 3 INCLUDE FILES
****************************************************************************
*/
#define IPCOM_USE_CLIB_PROTO
#include "ipcom_clib.h"
#include "ipcom_os.h"
#include "ipcom_file.h"
#include "ipcom_sock2.h"
#include <sys/fcntl.h>
#include <sys/types.h>
#include <stdarg.h>
#include <getopt.h>
#ifdef __cplusplus
extern "C" {
#endif
/*
****************************************************************************
* 4 DEFINES
****************************************************************************
*/
/*
*===========================================================================
* lseek
*===========================================================================
* whence values for lseek(2); renamed by POSIX 1003.1
*/
#define L_SET IP_SEEK_SET
#define L_INCR IP_SEEK_CUR
#define L_XTND IP_SEEK_END
/*
****************************************************************************
* 5 TYPES
****************************************************************************
*/
/*
****************************************************************************
* 6 FUNCTIONS
****************************************************************************
*/
#if defined(IPCOM_GETHOSTNAME) && IPCOM_GETHOSTNAME == 1
#define gethostname(n,l) ipcom_gethostname(n,l)
#elif defined(IPCOM_GETHOSTNAME)
#define gethostname(n,l) IPCOM_GETHOSTNAME(n,l)
#endif
#if defined(IPCOM_SETHOSTNAME) && IPCOM_SETHOSTNAME == 1
#define sethostname(n,l) ipcom_sethostname(n,l)
#elif defined(IPCOM_SETHOSTNAME)
#define sethostname(n,l) IPCOM_SETHOSTNAME(n,l)
#endif
#ifndef NETSNMP_INTERPEAK
#define open(a,b,c) ipcom_fileopen(a,b,c)
#endif
#if defined(GATED_INTERPEAK) || defined(IPCOM_SOCKETIO_DEFAULT)
#define close(a1) ipcom_socketclose(a1)
#define write(a1,a2,a3) ipcom_socketwrite(a1,a2,a3)
#define read(a1,a2,a3) ipcom_socketread(a1,a2,a3)
#else
#define close(a1) ipcom_fileclose(a1)
#define write(a1,a2,a3) ipcom_filewrite(a1,a2,a3)
#define read(a1,a2,a3) ipcom_fileread(a1,a2,a3)
#endif
#define mkdir(p,m) ipcom_mkdir(p,m)
#define rmdir(p) ipcom_rmdir(p)
#define chdir(p) ipcom_chdir(p)
#define getcwd(b,s) ipcom_getcwd(b,s)
#define unlink(p) ipcom_unlink(p)
#define rename(o,n) ipcom_rename(o,n)
#define getpid ipcom_getpid
#define getuid ipcom_getuid
#define geteuid ipcom_getuid
#define getgid ipcom_getuid
#define getegid ipcom_getuid
#define access(a1,a2) ipcom_access(a1,a2)
#define sleep(a1) ipcom_sleep(a1)
#define select(a1,a2,a3,a4,a5) ipcom_socketselect(a1,a2,a3,a4,a5)
extern unsigned int alarm (unsigned int);
#ifdef NETSNMP_INTERPEAK
#define dup(o) ipnetsnmp_dup(o)
IP_PUBLIC int ipnetsnmp_dup(int oldfd);
#define fork ipnetsnmp_fork
IP_PUBLIC pid_t ipnetsnmp_fork(void);
#define pipe(f) ipnetsnmp_pipe(f)
IP_PUBLIC int ipnetsnmp_pipe(int fildes[2]);
#define getdtablesize ipnetsnmp_getdtablesize
IP_PUBLIC int ipnetsnmp_getdtablesize(void);
#define execv(p,a) ipnetsnmp_execv(p,a)
IP_PUBLIC int ipnetsnmp_execv(const char *path, char *const argv[]);
#define usleep(u) ipnetsnmp_usleep(u)
IP_PUBLIC void ipnetsnmp_usleep(unsigned long usec);
#define alarm(s) ipnetsnmp_alarm(s)
IP_PUBLIC unsigned int ipnetsnmp_alarm(unsigned int seconds);
#define setgid(g) ipnetsnmp_setgid(g)
IP_PUBLIC int ipnetsnmp_setgid(gid_t gid);
#define setgroups(s,l) ipnetsnmp_setgroups(s,l)
IP_PUBLIC int ipnetsnmp_setgroups(size_t size, const gid_t *list);
#define setuid(u) ipnetsnmp_setuid(u)
IP_PUBLIC int ipnetsnmp_setuid(uid_t uid);
#define setsid ipnetsnmp_setsid
IP_PUBLIC pid_t ipnetsnmp_setsid(void);
#ifdef close
#undef close
#endif
#define close(a1) ipnetsnmp_close(a1)
IP_PUBLIC int ipnetsnmp_close(Ip_fd fd);
#ifdef write
#undef write
#endif
#define write(a1,a2,a3) ipnetsnmp_write(a1,a2,a3)
IP_PUBLIC Ip_ssize_t ipnetsnmp_write(Ip_fd fd, const void *buf, Ip_size_t nbytes);
#ifdef read
#undef read
#endif
#define read(a1,a2,a3) ipnetsnmp_read(a1,a2,a3)
IP_PUBLIC Ip_ssize_t ipnetsnmp_read(Ip_fd fd, void *buf, Ip_size_t nbytes);
#endif /* #ifdef NETSNMP_INTERPEAK */
#ifdef __cplusplus
}
#endif
#endif
/*
****************************************************************************
* END OF FILE
****************************************************************************
*/