00001 /* $Id: replace.h,v 1.3 2008-01-15 01:25:42 rtv Exp $ 00002 * 00003 * replacement function prototypes 00004 */ 00005 00006 #ifndef _REPLACE_H 00007 #define _REPLACE_H 00008 00009 00010 #if HAVE_CONFIG_H 00011 #include <config.h> 00012 #endif 00013 00014 /* Compatibility definitions for System V `poll' interface. 00015 Copyright (C) 1994,96,97,98,99,2000 Free Software Foundation, Inc. 00016 This file is part of the GNU C Library. 00017 00018 The GNU C Library is free software; you can redistribute it and/or 00019 modify it under the terms of the GNU Library General Public License as 00020 published by the Free Software Foundation; either version 2 of the 00021 License, or (at your option) any later version. 00022 00023 The GNU C Library is distributed in the hope that it will be useful, 00024 but WITHOUT ANY WARRANTY; without even the implied warranty of 00025 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 00026 Library General Public License for more details. 00027 00028 You should have received a copy of the GNU Library General Public 00029 License along with the GNU C Library; see the file COPYING.LIB. If not, 00030 write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, 00031 Boston, MA 02111-1307, USA. */ 00032 00033 #ifdef __cplusplus 00034 extern "C" { 00035 #endif 00036 00037 #if !HAVE_POLL 00038 /* Event types that can be polled for. These bits may be set in `events' 00039 to indicate the interesting event types; they will appear in `revents' 00040 to indicate the status of the file descriptor. */ 00041 #define POLLIN 01 /* There is data to read. */ 00042 #define POLLPRI 02 /* There is urgent data to read. */ 00043 #define POLLOUT 04 /* Writing now will not block. */ 00044 00045 /* Some aliases. */ 00046 #define POLLWRNORM POLLOUT 00047 #define POLLRDNORM POLLIN 00048 #define POLLRDBAND POLLPRI 00049 00050 /* Event types always implicitly polled for. These bits need not be set in 00051 `events', but they will appear in `revents' to indicate the status of 00052 the file descriptor. */ 00053 #define POLLERR 010 /* Error condition. */ 00054 #define POLLHUP 020 /* Hung up. */ 00055 #define POLLNVAL 040 /* Invalid polling request. */ 00056 00057 /* Canonical number of polling requests to read in at a time in poll. */ 00058 #define NPOLLFILE 30 00059 00060 /* Data structure describing a polling request. */ 00061 struct pollfd 00062 { 00063 int fd; /* File descriptor to poll. */ 00064 short int events; /* Types of events poller cares about. */ 00065 short int revents; /* Types of events that actually occurred. */ 00066 }; 00067 00068 00069 /* Poll the file descriptors described by the NFDS structures starting at 00070 FDS. If TIMEOUT is nonzero and not -1, allow TIMEOUT milliseconds for 00071 an event to occur; if TIMEOUT is -1, block until an event occurs. 00072 Returns the number of file descriptors with events, zero if timed out, 00073 or -1 for errors. */ 00074 int poll (struct pollfd *fds, unsigned long int nfds, int timeout); 00075 #else 00076 #include <sys/poll.h> /* for poll(2) */ 00077 #endif // !HAVE_POLL 00078 00079 //#if !HAVE_SCANDIR 00080 //#include <sys/types.h> 00081 //#include <dirent.h> 00082 //int scandir(const char *dir, struct dirent ***namelist, 00083 // int (*select)(const struct dirent *), 00084 // int (*compar)(const struct dirent **, const struct dirent **)); 00085 //#endif //!HAVE_SCANDIR 00086 00087 /* 00088 00089 #if !HAVE_DIRNAME 00090 char * dirname (char *path); 00091 #else 00092 #include <libgen.h> // for dirname(3) 00093 #endif // !HAVE_DIRNAME 00094 00095 #if !HAVE_BASENAME 00096 const char * basename (const char* filename); 00097 #else 00098 #include <libgen.h> // for basename(3) 00099 #endif // !HAVE_BASENAME 00100 */ 00101 00102 #ifdef __cplusplus 00103 } 00104 #endif 00105 00106 #endif 00107