Changeset 811fae1 in rtems
- Timestamp:
- 11/02/99 19:24:38 (23 years ago)
- Branches:
- 4.10, 4.11, 4.8, 4.9, 5, master
- Children:
- 317a5b5
- Parents:
- 07e0743
- Files:
-
- 20 added
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
c/src/exec/posix/src/Makefile.in
r07e0743 r811fae1 30 30 conddestroy condinit condmp condsignal condsignalsupp condtimedwait \ 31 31 condwait condwaitsupp 32 33 ID_C_PIECES= getegid geteuid getgid getgroups getlogin getpgrp getpid getppid \ 34 getuid setpgid setsid 32 35 33 36 KEY_C_PIECES= key keycreate keydelete keygetspecific keyrundestructors \ … … 79 82 80 83 C_PIECES = adasupp $(CANCEL_C_PIECES) $(CONDITION_VARIABLE_C_PIECES) \ 81 getpid$(KEY_C_PIECES) $(MESSAGE_QUEUE_C_PIECES) \84 $(ID_C_PIECES) $(KEY_C_PIECES) $(MESSAGE_QUEUE_C_PIECES) \ 82 85 $(MUTEX_C_PIECES) $(PTHREAD_C_PIECES) \ 83 86 $(PSIGNAL_C_PIECES) sched $(SEMAPHORE_C_PIECES) \ -
c/src/exec/posix/src/types.c
r07e0743 r811fae1 1 1 /* 2 * This file is the shell of what it initially was and is now misnamed. 3 * 2 4 * $Id$ 3 5 */ … … 11 13 #include <rtems/score/object.h> 12 14 #include <rtems/posix/seterr.h> 13 14 pid_t _POSIX_types_Ppid = 0;15 uid_t _POSIX_types_Uid = 0;16 uid_t _POSIX_types_Euid = 0;17 gid_t _POSIX_types_Gid = 0;18 gid_t _POSIX_types_Egid = 0;19 20 /*PAGE21 *22 * 4.1.1 Get Process and Parent Process IDs, P1003.1b-1993, p. 8323 */24 25 pid_t getppid( void )26 {27 return _POSIX_types_Ppid;28 }29 30 /*PAGE31 *32 * 4.2.1 Get Real User, Effective User, Ral Group, and Effective Group IDs,33 * P1003.1b-1993, p. 8434 */35 36 uid_t getuid( void )37 {38 return _POSIX_types_Uid;39 }40 41 /*PAGE42 *43 * 4.2.1 Get Real User, Effective User, Ral Group, and Effective Group IDs,44 * P1003.1b-1993, p. 8445 */46 47 uid_t geteuid( void )48 {49 return _POSIX_types_Euid;50 }51 52 /*PAGE53 *54 * 4.2.1 Get Real User, Effective User, Ral Group, and Effective Group IDs,55 * P1003.1b-1993, p. 8456 */57 58 gid_t getgid( void )59 {60 return _POSIX_types_Gid;61 }62 63 /*PAGE64 *65 * 4.2.1 Get Real User, Effective User, Ral Group, and Effective Group IDs,66 * P1003.1b-1993, p. 8467 */68 69 gid_t getegid( void )70 {71 return _POSIX_types_Egid;72 }73 74 /*PAGE75 *76 * 4.2.2 Set User and Group IDs, P1003.1b-1993, p. 8477 */78 79 int setuid(80 uid_t uid81 )82 {83 _POSIX_types_Uid = uid;84 return 0;85 }86 87 /*PAGE88 *89 * 4.2.2 Set User and Group IDs, P1003.1b-1993, p. 8490 */91 92 int setgid(93 gid_t gid94 )95 {96 _POSIX_types_Gid = gid;97 return 0;98 }99 100 /*PAGE101 *102 * 4.2.3 Get Supplementary IDs, P1003.1b-1993, p. 86103 */104 105 int getgroups(106 int gidsetsize,107 gid_t grouplist[]108 )109 {110 return 0; /* no supplemental group ids */111 }112 113 /*PAGE114 *115 * 4.2.4 Get User Name, P1003.1b-1993, p. 87116 *117 * NOTE: P1003.1c/D10, p. 49 adds getlogin_r().118 */119 120 static char _POSIX_types_Getlogin_buffer[ LOGIN_NAME_MAX ];121 122 char *getlogin( void )123 {124 (void) getlogin_r( _POSIX_types_Getlogin_buffer, LOGIN_NAME_MAX );125 return _POSIX_types_Getlogin_buffer;126 }127 128 /*PAGE129 *130 * 4.2.4 Get User Name, P1003.1b-1993, p. 87131 *132 * NOTE: P1003.1c/D10, p. 49 adds getlogin_r().133 */134 135 int getlogin_r(136 char *name,137 size_t namesize138 )139 {140 if ( namesize < LOGIN_NAME_MAX )141 return ERANGE;142 143 strcpy( name, "posixapp" );144 return 0;145 }146 147 /*PAGE148 *149 * 4.3.1 Get Process Group IDs, P1003.1b-1993, p. 89150 */151 152 pid_t getpgrp( void )153 {154 /*155 * This always succeeds and returns the process group id. For rtems,156 * this will always be the local node;157 */158 159 return _Objects_Local_node;160 }161 162 /*PAGE163 *164 * 4.3.2 Create Session and Set Process Group ID, P1003.1b-1993, p. 88165 */166 167 pid_t setsid( void )168 {169 set_errno_and_return_minus_one( ENOSYS );170 }171 172 /*PAGE173 *174 * 4.3.3 Set Process Group ID for Job Control, P1003.1b-1993, p. 89175 */176 177 int setpgid(178 pid_t pid,179 pid_t pgid180 )181 {182 set_errno_and_return_minus_one( ENOSYS );183 }184 15 185 16 /* -
cpukit/posix/src/types.c
r07e0743 r811fae1 1 1 /* 2 * This file is the shell of what it initially was and is now misnamed. 3 * 2 4 * $Id$ 3 5 */ … … 11 13 #include <rtems/score/object.h> 12 14 #include <rtems/posix/seterr.h> 13 14 pid_t _POSIX_types_Ppid = 0;15 uid_t _POSIX_types_Uid = 0;16 uid_t _POSIX_types_Euid = 0;17 gid_t _POSIX_types_Gid = 0;18 gid_t _POSIX_types_Egid = 0;19 20 /*PAGE21 *22 * 4.1.1 Get Process and Parent Process IDs, P1003.1b-1993, p. 8323 */24 25 pid_t getppid( void )26 {27 return _POSIX_types_Ppid;28 }29 30 /*PAGE31 *32 * 4.2.1 Get Real User, Effective User, Ral Group, and Effective Group IDs,33 * P1003.1b-1993, p. 8434 */35 36 uid_t getuid( void )37 {38 return _POSIX_types_Uid;39 }40 41 /*PAGE42 *43 * 4.2.1 Get Real User, Effective User, Ral Group, and Effective Group IDs,44 * P1003.1b-1993, p. 8445 */46 47 uid_t geteuid( void )48 {49 return _POSIX_types_Euid;50 }51 52 /*PAGE53 *54 * 4.2.1 Get Real User, Effective User, Ral Group, and Effective Group IDs,55 * P1003.1b-1993, p. 8456 */57 58 gid_t getgid( void )59 {60 return _POSIX_types_Gid;61 }62 63 /*PAGE64 *65 * 4.2.1 Get Real User, Effective User, Ral Group, and Effective Group IDs,66 * P1003.1b-1993, p. 8467 */68 69 gid_t getegid( void )70 {71 return _POSIX_types_Egid;72 }73 74 /*PAGE75 *76 * 4.2.2 Set User and Group IDs, P1003.1b-1993, p. 8477 */78 79 int setuid(80 uid_t uid81 )82 {83 _POSIX_types_Uid = uid;84 return 0;85 }86 87 /*PAGE88 *89 * 4.2.2 Set User and Group IDs, P1003.1b-1993, p. 8490 */91 92 int setgid(93 gid_t gid94 )95 {96 _POSIX_types_Gid = gid;97 return 0;98 }99 100 /*PAGE101 *102 * 4.2.3 Get Supplementary IDs, P1003.1b-1993, p. 86103 */104 105 int getgroups(106 int gidsetsize,107 gid_t grouplist[]108 )109 {110 return 0; /* no supplemental group ids */111 }112 113 /*PAGE114 *115 * 4.2.4 Get User Name, P1003.1b-1993, p. 87116 *117 * NOTE: P1003.1c/D10, p. 49 adds getlogin_r().118 */119 120 static char _POSIX_types_Getlogin_buffer[ LOGIN_NAME_MAX ];121 122 char *getlogin( void )123 {124 (void) getlogin_r( _POSIX_types_Getlogin_buffer, LOGIN_NAME_MAX );125 return _POSIX_types_Getlogin_buffer;126 }127 128 /*PAGE129 *130 * 4.2.4 Get User Name, P1003.1b-1993, p. 87131 *132 * NOTE: P1003.1c/D10, p. 49 adds getlogin_r().133 */134 135 int getlogin_r(136 char *name,137 size_t namesize138 )139 {140 if ( namesize < LOGIN_NAME_MAX )141 return ERANGE;142 143 strcpy( name, "posixapp" );144 return 0;145 }146 147 /*PAGE148 *149 * 4.3.1 Get Process Group IDs, P1003.1b-1993, p. 89150 */151 152 pid_t getpgrp( void )153 {154 /*155 * This always succeeds and returns the process group id. For rtems,156 * this will always be the local node;157 */158 159 return _Objects_Local_node;160 }161 162 /*PAGE163 *164 * 4.3.2 Create Session and Set Process Group ID, P1003.1b-1993, p. 88165 */166 167 pid_t setsid( void )168 {169 set_errno_and_return_minus_one( ENOSYS );170 }171 172 /*PAGE173 *174 * 4.3.3 Set Process Group ID for Job Control, P1003.1b-1993, p. 89175 */176 177 int setpgid(178 pid_t pid,179 pid_t pgid180 )181 {182 set_errno_and_return_minus_one( ENOSYS );183 }184 15 185 16 /*
Note: See TracChangeset
for help on using the changeset viewer.