Skip to content

Commit

Permalink
tools/nolibc/types: add poll() and waitpid() flag definitions
Browse files Browse the repository at this point in the history
- POLLIN etc were missing, so poll() could only be used with timeouts.
- WNOHANG was not defined and is convenient to check if a child is still
  running

Signed-off-by: Willy Tarreau <[email protected]>
Signed-off-by: Paul E. McKenney <[email protected]>
  • Loading branch information
wtarreau authored and paulmckrcu committed Apr 21, 2022
1 parent 54abe35 commit 96d2a13
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions tools/include/nolibc/types.h
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,9 @@
#define WEXITSTATUS(status) (((status) & 0xff00) >> 8)
#define WIFEXITED(status) (((status) & 0x7f) == 0)

/* waitpid() flags */
#define WNOHANG 1

/* standard exit() codes */
#define EXIT_SUCCESS 0
#define EXIT_FAILURE 1
Expand Down Expand Up @@ -122,6 +125,13 @@ typedef struct {
} while (0)

/* for poll() */
#define POLLIN 0x0001
#define POLLPRI 0x0002
#define POLLOUT 0x0004
#define POLLERR 0x0008
#define POLLHUP 0x0010
#define POLLNVAL 0x0020

struct pollfd {
int fd;
short int events;
Expand Down

0 comments on commit 96d2a13

Please sign in to comment.