Main Page
Related Pages
Modules
Namespaces
Classes
Files
File List
File Members
replace
replace.h
Go to the documentation of this file.
1
/* $Id: replace.h,v 1.3 2008-01-15 01:25:42 rtv Exp $
2
*
3
* replacement function prototypes
4
*/
5
6
#ifndef _REPLACE_H
7
#define _REPLACE_H
8
9
10
#if HAVE_CONFIG_H
11
#include <config.h>
12
#endif
13
14
/* Compatibility definitions for System V `poll' interface.
15
Copyright (C) 1994,96,97,98,99,2000 Free Software Foundation, Inc.
16
This file is part of the GNU C Library.
17
18
The GNU C Library is free software; you can redistribute it and/or
19
modify it under the terms of the GNU Library General Public License as
20
published by the Free Software Foundation; either version 2 of the
21
License, or (at your option) any later version.
22
23
The GNU C Library is distributed in the hope that it will be useful,
24
but WITHOUT ANY WARRANTY; without even the implied warranty of
25
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
26
Library General Public License for more details.
27
28
You should have received a copy of the GNU Library General Public
29
License along with the GNU C Library; see the file COPYING.LIB. If not,
30
write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
31
Boston, MA 02111-1307, USA. */
32
33
#ifdef __cplusplus
34
extern
"C"
{
35
#endif
36
37
#if !HAVE_POLL
38
/* Event types that can be polled for. These bits may be set in `events'
39
to indicate the interesting event types; they will appear in `revents'
40
to indicate the status of the file descriptor. */
41
#define POLLIN 01
/* There is data to read. */
42
#define POLLPRI 02
/* There is urgent data to read. */
43
#define POLLOUT 04
/* Writing now will not block. */
44
45
/* Some aliases. */
46
#define POLLWRNORM POLLOUT
47
#define POLLRDNORM POLLIN
48
#define POLLRDBAND POLLPRI
49
50
/* Event types always implicitly polled for. These bits need not be set in
51
`events', but they will appear in `revents' to indicate the status of
52
the file descriptor. */
53
#define POLLERR 010
/* Error condition. */
54
#define POLLHUP 020
/* Hung up. */
55
#define POLLNVAL 040
/* Invalid polling request. */
56
57
/* Canonical number of polling requests to read in at a time in poll. */
58
#define NPOLLFILE 30
59
60
/* Data structure describing a polling request. */
61
struct
pollfd
62
{
63
int
fd
;
/* File descriptor to poll. */
64
short
int
events
;
/* Types of events poller cares about. */
65
short
int
revents
;
/* Types of events that actually occurred. */
66
};
67
68
69
/* Poll the file descriptors described by the NFDS structures starting at
70
FDS. If TIMEOUT is nonzero and not -1, allow TIMEOUT milliseconds for
71
an event to occur; if TIMEOUT is -1, block until an event occurs.
72
Returns the number of file descriptors with events, zero if timed out,
73
or -1 for errors. */
74
int
poll
(
struct
pollfd
*fds,
unsigned
long
int
nfds,
int
timeout);
75
#else
76
#include <sys/poll.h>
/* for poll(2) */
77
#endif // !HAVE_POLL
78
79
//#if !HAVE_SCANDIR
80
//#include <sys/types.h>
81
//#include <dirent.h>
82
//int scandir(const char *dir, struct dirent ***namelist,
83
// int (*select)(const struct dirent *),
84
// int (*compar)(const struct dirent **, const struct dirent **));
85
//#endif //!HAVE_SCANDIR
86
87
/*
88
89
#if !HAVE_DIRNAME
90
char * dirname (char *path);
91
#else
92
#include <libgen.h> // for dirname(3)
93
#endif // !HAVE_DIRNAME
94
95
#if !HAVE_BASENAME
96
const char * basename (const char* filename);
97
#else
98
#include <libgen.h> // for basename(3)
99
#endif // !HAVE_BASENAME
100
*/
101
102
#ifdef __cplusplus
103
}
104
#endif
105
106
#endif
107
poll
int poll(struct pollfd *fds, unsigned long int nfds, int timeout)
Definition:
poll.c:43
pollfd
Definition:
replace.h:61
pollfd::fd
int fd
Definition:
replace.h:63
pollfd::events
short int events
Definition:
replace.h:64
pollfd::revents
short int revents
Definition:
replace.h:65
stage
Author(s): Richard Vaughan
, Brian Gerkey
, Reed Hedges
, Andrew Howard
, Toby Collett
, Pooya Karimian
, Jeremy Asher
, Alex Couture-Beil
, Geoff Biggs
, Rich Mattes
, Abbas Sadat
autogenerated on Mon Jun 10 2019 15:06:09