diff options
author | scottc <scottc> | 2002-07-03 01:48:41 +0000 |
---|---|---|
committer | scottc <scottc> | 2002-07-03 01:48:41 +0000 |
commit | eea6a644adf1641beca7744f6f4aecc82191331e (patch) | |
tree | 817c266dc678900bd378e08adae6ffa4863afcd2 | |
parent | d4af2c25576021e01f8c4448007b2dbdd01f2fd5 (diff) | |
download | gdb-eea6a644adf1641beca7744f6f4aecc82191331e.tar.gz |
dos2unix cygserver_ipc.h
-rw-r--r-- | winsup/cygwin/cygserver_ipc.h | 142 |
1 files changed, 71 insertions, 71 deletions
diff --git a/winsup/cygwin/cygserver_ipc.h b/winsup/cygwin/cygserver_ipc.h index a69dd9c881d..f57a4649d8c 100644 --- a/winsup/cygwin/cygserver_ipc.h +++ b/winsup/cygwin/cygserver_ipc.h @@ -1,71 +1,71 @@ -/* cygserver_ipc.h
-
- Copyright 2002 Red Hat, Inc.
-
- Originally written by Conrad Scott <conrad.scott@dsl.pipex.com>
-
-This file is part of Cygwin.
-
-This software is a copyrighted work licensed under the terms of the
-Cygwin license. Please consult the file "CYGWIN_LICENSE" for
-details. */
-
-#ifndef __CYGSERVER_IPC_H__
-#define __CYGSERVER_IPC_H__
-
-#include <limits.h> /* For OPEN_MAX. */
-
-/*
- * The sysv ipc id's (msgid, semid, shmid) are small integers arranged
- * such that they no subsystem will generate the same id as some other
- * subsystem, and nor do these ids overlap file descriptors (the other
- * common small integer ids). Since Cygwin can allocate more than
- * OPEN_MAX file descriptor, it can't be guarenteed not to overlap,
- * but it should help catch some errors.
- *
- * msgid's: OPEN_MAX, OPEN_MAX + 3, OPEN_MAX + 6, . . .
- * semid's: OPEN_MAX + 1, OPEN_MAX + 4, OPEN_MAX + 7, . . .
- * shmid's: OPEN_MAX + 2, OPEN_MAX + 5, OPEN_MAX + 8, . . .
- *
- * Internal ipc id's, which are 0, 1, ... within each subsystem, are
- * used solely by the ipcs(8) interface.
- */
-
-enum ipc_subsys_t {
- IPC_MSGOP = 0,
- IPC_SEMOP = 1,
- IPC_SHMOP = 2,
- IPC_SUBSYS_COUNT
-};
-
-inline int
-ipc_int2ext (const int id, const ipc_subsys_t subsys)
-{
- return OPEN_MAX + (id * IPC_SUBSYS_COUNT) + subsys;
-}
-
-inline int
-ipc_ext2int (const int id)
-{
- return (id - OPEN_MAX) / IPC_SUBSYS_COUNT;
-}
-
-inline int
-ipc_ext2int_subsys (const int id)
-{
- return (id - OPEN_MAX) % IPC_SUBSYS_COUNT;
-}
-
-inline int
-ipc_inc_id (const int id, const ipc_subsys_t subsys)
-{
- return id + IPC_SUBSYS_COUNT;
-}
-
-inline int
-ipc_dec_id (const int id, const ipc_subsys_t subsys)
-{
- return id - IPC_SUBSYS_COUNT;
-}
-
-#endif /* __CYGSERVER_IPC_H__ */
+/* cygserver_ipc.h + + Copyright 2002 Red Hat, Inc. + + Originally written by Conrad Scott <conrad.scott@dsl.pipex.com> + +This file is part of Cygwin. + +This software is a copyrighted work licensed under the terms of the +Cygwin license. Please consult the file "CYGWIN_LICENSE" for +details. */ + +#ifndef __CYGSERVER_IPC_H__ +#define __CYGSERVER_IPC_H__ + +#include <limits.h> /* For OPEN_MAX. */ + +/* + * The sysv ipc id's (msgid, semid, shmid) are small integers arranged + * such that they no subsystem will generate the same id as some other + * subsystem, and nor do these ids overlap file descriptors (the other + * common small integer ids). Since Cygwin can allocate more than + * OPEN_MAX file descriptor, it can't be guarenteed not to overlap, + * but it should help catch some errors. + * + * msgid's: OPEN_MAX, OPEN_MAX + 3, OPEN_MAX + 6, . . . + * semid's: OPEN_MAX + 1, OPEN_MAX + 4, OPEN_MAX + 7, . . . + * shmid's: OPEN_MAX + 2, OPEN_MAX + 5, OPEN_MAX + 8, . . . + * + * Internal ipc id's, which are 0, 1, ... within each subsystem, are + * used solely by the ipcs(8) interface. + */ + +enum ipc_subsys_t { + IPC_MSGOP = 0, + IPC_SEMOP = 1, + IPC_SHMOP = 2, + IPC_SUBSYS_COUNT +}; + +inline int +ipc_int2ext (const int id, const ipc_subsys_t subsys) +{ + return OPEN_MAX + (id * IPC_SUBSYS_COUNT) + subsys; +} + +inline int +ipc_ext2int (const int id) +{ + return (id - OPEN_MAX) / IPC_SUBSYS_COUNT; +} + +inline int +ipc_ext2int_subsys (const int id) +{ + return (id - OPEN_MAX) % IPC_SUBSYS_COUNT; +} + +inline int +ipc_inc_id (const int id, const ipc_subsys_t subsys) +{ + return id + IPC_SUBSYS_COUNT; +} + +inline int +ipc_dec_id (const int id, const ipc_subsys_t subsys) +{ + return id - IPC_SUBSYS_COUNT; +} + +#endif /* __CYGSERVER_IPC_H__ */ |