* Added BSD's FD_COPY() macro (it's not POSIX, though).

* Some other minor improvements.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@23826 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
Axel Dörfler
2008-02-02 17:32:01 +00:00
parent 987de53746
commit b4fd412b3e
4 changed files with 22 additions and 15 deletions
+5 -4
View File
@@ -1,8 +1,9 @@
/*
* Copyright 2004-2008, Haiku Inc. All Rights Reserved.
* Distributed under the terms of the MIT License.
*/
#ifndef _GRP_H_
#define _GRP_H_
/*
** Distributed under the terms of the Haiku License.
*/
#include <sys/types.h>
@@ -11,7 +12,7 @@
struct group {
char *gr_name;
char *gr_passwd;
int gr_gid;
gid_t gr_gid;
char **gr_mem;
};
+6 -3
View File
@@ -25,12 +25,13 @@
/* These are various BeOS implementation limits */
#define ARG_MAX (32768)
#define ATEXIT_MAX (32) /* XXXdbg */
#define ATEXIT_MAX (32)
#define CHILD_MAX (1024)
#define IOV_MAX (1024)
#define FILESIZEBITS (64)
#define LINE_MAX (2048)
#define LINK_MAX (1)
#define LOGIN_NAME_MAX (32) /* XXXdbg */
#define LOGIN_NAME_MAX (32)
#define MAX_CANON (255)
#define MAX_INPUT (255)
#define NAME_MAX (256)
@@ -47,7 +48,7 @@
#define _POSIX_ARG_MAX (32768)
#define _POSIX_CHILD_MAX (1024)
#define _POSIX_LINK_MAX (1)
#define _POSIX_LOGIN_NAME_MAX (9) /* XXXdbg */
#define _POSIX_LOGIN_NAME_MAX (9)
#define _POSIX_MAX_CANON (255)
#define _POSIX_MAX_INPUT (255)
#define _POSIX_NAME_MAX (255)
@@ -60,4 +61,6 @@
#define _POSIX_TTY_NAME_MAX (256)
#define _POSIX_TZNAME_MAX (3)
#define _POSIX2_LINE_MAX (2048)
#endif /* _LIBC_LIMITS_H_ */
+1
View File
@@ -41,6 +41,7 @@ typedef struct fd_set {
#define FD_SET(fd, set) ((set)->bits[_FD_BITSINDEX(fd)] |= _FD_BIT(fd))
#define FD_CLR(fd, set) ((set)->bits[_FD_BITSINDEX(fd)] &= ~_FD_BIT(fd))
#define FD_ISSET(fd, set) ((set)->bits[_FD_BITSINDEX(fd)] & _FD_BIT(fd))
#define FD_COPY(source, target) (*(target) = *(source))
#endif /* FD_SET */
+10 -8
View File
@@ -1,11 +1,12 @@
/*
** Distributed under the terms of the OpenBeOS License.
*/
/*
* Copyright 2003-2008, Haiku Inc. All Rights Reserved.
* Distributed under the terms of the MIT License.
*/
#ifndef _SYSLOG_H_
#define _SYSLOG_H_
/*** options for openlog() ***/
/* options for openlog() */
#define LOG_PID (1 << 12) /* log the process (thread/team) ID with each message */
#define LOG_CONS (2 << 12) /* log to the system console on error */
@@ -16,7 +17,7 @@
#define LOG_NOWAIT (64 << 12) /* do not wait for child processes */
/*** facilities ***/
/* facilities */
#define LOG_KERN (0 << 3) /* messages generated by the kernel */
#define LOG_USER (1 << 3) /* by user processes */
@@ -29,6 +30,7 @@
#define LOG_UUCP (8 << 3)
#define LOG_CRON (9 << 3)
#define LOG_AUTHPRIV (10 << 3)
#define LOG_FTP (11 << 3)
/* these are for local use: */
#define LOG_LOCAL0 (16 << 3)
@@ -41,7 +43,7 @@
#define LOG_LOCAL7 (23 << 3)
/*** priorities ***/
/* priorities */
#define LOG_EMERG 0 /* a panic condition */
#define LOG_PANIC LOG_EMERG
@@ -61,13 +63,13 @@
extern "C" {
#endif
// POSIX calls
/* POSIX calls */
extern void closelog(void);
extern void openlog(const char *ident, int options, int facility);
extern int setlogmask(int priorityMask);
extern void syslog(int priority, const char *message, ...);
// Be extensions
/* Be extensions */
extern void closelog_team(void);
extern void openlog_team(const char *ident, int logopt, int facility);
extern void log_team(int priority, const char *message, ...);