Changeset 811fae1 in rtems


Ignore:
Timestamp:
Nov 2, 1999, 7:24:38 PM (20 years ago)
Author:
Joel Sherrill <joel.sherrill@…>
Branches:
4.10, 4.11, 4.8, 4.9, master
Children:
317a5b5
Parents:
07e0743
Message:

Split types.s into individual files.

Files:
20 added
3 edited

Legend:

Unmodified
Added
Removed
  • c/src/exec/posix/src/Makefile.in

    r07e0743 r811fae1  
    3030    conddestroy condinit condmp condsignal condsignalsupp condtimedwait \
    3131    condwait condwaitsupp
     32
     33ID_C_PIECES= getegid geteuid getgid getgroups getlogin getpgrp getpid getppid \
     34    getuid setpgid setsid
    3235
    3336KEY_C_PIECES= key keycreate keydelete keygetspecific keyrundestructors \
     
    7982
    8083C_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) \
    8285    $(MUTEX_C_PIECES) $(PTHREAD_C_PIECES) \
    8386    $(PSIGNAL_C_PIECES) sched $(SEMAPHORE_C_PIECES) \
  • c/src/exec/posix/src/types.c

    r07e0743 r811fae1  
    11/*
     2 *  This file is the shell of what it initially was and is now misnamed.
     3 *
    24 *  $Id$
    35 */
     
    1113#include <rtems/score/object.h>
    1214#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 /*PAGE
    21  *
    22  *  4.1.1 Get Process and Parent Process IDs, P1003.1b-1993, p. 83
    23  */
    24 
    25 pid_t getppid( void )
    26 {
    27   return _POSIX_types_Ppid;
    28 }
    29 
    30 /*PAGE
    31  *
    32  *  4.2.1 Get Real User, Effective User, Ral Group, and Effective Group IDs,
    33  *        P1003.1b-1993, p. 84
    34  */
    35 
    36 uid_t getuid( void )
    37 {
    38   return _POSIX_types_Uid;
    39 }
    40 
    41 /*PAGE
    42  *
    43  *  4.2.1 Get Real User, Effective User, Ral Group, and Effective Group IDs,
    44  *        P1003.1b-1993, p. 84
    45  */
    46 
    47 uid_t geteuid( void )
    48 {
    49   return _POSIX_types_Euid;
    50 }
    51 
    52 /*PAGE
    53  *
    54  *  4.2.1 Get Real User, Effective User, Ral Group, and Effective Group IDs,
    55  *        P1003.1b-1993, p. 84
    56  */
    57 
    58 gid_t getgid( void )
    59 {
    60   return _POSIX_types_Gid;
    61 }
    62 
    63 /*PAGE
    64  *
    65  *  4.2.1 Get Real User, Effective User, Ral Group, and Effective Group IDs,
    66  *        P1003.1b-1993, p. 84
    67  */
    68 
    69 gid_t getegid( void )
    70 {
    71   return _POSIX_types_Egid;
    72 }
    73 
    74 /*PAGE
    75  *
    76  *  4.2.2 Set User and Group IDs, P1003.1b-1993, p. 84
    77  */
    78 
    79 int setuid(
    80   uid_t  uid
    81 )
    82 {
    83   _POSIX_types_Uid = uid;
    84   return 0;
    85 }
    86 
    87 /*PAGE
    88  *
    89  *  4.2.2 Set User and Group IDs, P1003.1b-1993, p. 84
    90  */
    91 
    92 int setgid(
    93   gid_t  gid
    94 )
    95 {
    96   _POSIX_types_Gid = gid;
    97   return 0;
    98 }
    99 
    100 /*PAGE
    101  *
    102  *  4.2.3 Get Supplementary IDs, P1003.1b-1993, p. 86
    103  */
    104 
    105 int getgroups(
    106   int    gidsetsize,
    107   gid_t  grouplist[]
    108 )
    109 {
    110   return 0;  /* no supplemental group ids */
    111 }
    112 
    113 /*PAGE
    114  *
    115  *  4.2.4 Get User Name, P1003.1b-1993, p. 87
    116  *
    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 /*PAGE
    129  *
    130  *  4.2.4 Get User Name, P1003.1b-1993, p. 87
    131  *
    132  *  NOTE:  P1003.1c/D10, p. 49 adds getlogin_r().
    133  */
    134 
    135 int getlogin_r(
    136   char   *name,
    137   size_t  namesize
    138 )
    139 {
    140   if ( namesize < LOGIN_NAME_MAX )
    141     return ERANGE;
    142 
    143   strcpy( name, "posixapp" );
    144   return 0;
    145 }
    146 
    147 /*PAGE
    148  *
    149  *  4.3.1 Get Process Group IDs, P1003.1b-1993, p. 89
    150  */
    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 /*PAGE
    163  *
    164  *  4.3.2 Create Session and Set Process Group ID, P1003.1b-1993, p. 88
    165  */
    166 
    167 pid_t setsid( void )
    168 {
    169   set_errno_and_return_minus_one( ENOSYS );
    170 }
    171 
    172 /*PAGE
    173  *
    174  *  4.3.3 Set Process Group ID for Job Control, P1003.1b-1993, p. 89
    175  */
    176 
    177 int setpgid(
    178   pid_t  pid,
    179   pid_t  pgid
    180 )
    181 {
    182   set_errno_and_return_minus_one( ENOSYS );
    183 }
    18415
    18516/*
  • cpukit/posix/src/types.c

    r07e0743 r811fae1  
    11/*
     2 *  This file is the shell of what it initially was and is now misnamed.
     3 *
    24 *  $Id$
    35 */
     
    1113#include <rtems/score/object.h>
    1214#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 /*PAGE
    21  *
    22  *  4.1.1 Get Process and Parent Process IDs, P1003.1b-1993, p. 83
    23  */
    24 
    25 pid_t getppid( void )
    26 {
    27   return _POSIX_types_Ppid;
    28 }
    29 
    30 /*PAGE
    31  *
    32  *  4.2.1 Get Real User, Effective User, Ral Group, and Effective Group IDs,
    33  *        P1003.1b-1993, p. 84
    34  */
    35 
    36 uid_t getuid( void )
    37 {
    38   return _POSIX_types_Uid;
    39 }
    40 
    41 /*PAGE
    42  *
    43  *  4.2.1 Get Real User, Effective User, Ral Group, and Effective Group IDs,
    44  *        P1003.1b-1993, p. 84
    45  */
    46 
    47 uid_t geteuid( void )
    48 {
    49   return _POSIX_types_Euid;
    50 }
    51 
    52 /*PAGE
    53  *
    54  *  4.2.1 Get Real User, Effective User, Ral Group, and Effective Group IDs,
    55  *        P1003.1b-1993, p. 84
    56  */
    57 
    58 gid_t getgid( void )
    59 {
    60   return _POSIX_types_Gid;
    61 }
    62 
    63 /*PAGE
    64  *
    65  *  4.2.1 Get Real User, Effective User, Ral Group, and Effective Group IDs,
    66  *        P1003.1b-1993, p. 84
    67  */
    68 
    69 gid_t getegid( void )
    70 {
    71   return _POSIX_types_Egid;
    72 }
    73 
    74 /*PAGE
    75  *
    76  *  4.2.2 Set User and Group IDs, P1003.1b-1993, p. 84
    77  */
    78 
    79 int setuid(
    80   uid_t  uid
    81 )
    82 {
    83   _POSIX_types_Uid = uid;
    84   return 0;
    85 }
    86 
    87 /*PAGE
    88  *
    89  *  4.2.2 Set User and Group IDs, P1003.1b-1993, p. 84
    90  */
    91 
    92 int setgid(
    93   gid_t  gid
    94 )
    95 {
    96   _POSIX_types_Gid = gid;
    97   return 0;
    98 }
    99 
    100 /*PAGE
    101  *
    102  *  4.2.3 Get Supplementary IDs, P1003.1b-1993, p. 86
    103  */
    104 
    105 int getgroups(
    106   int    gidsetsize,
    107   gid_t  grouplist[]
    108 )
    109 {
    110   return 0;  /* no supplemental group ids */
    111 }
    112 
    113 /*PAGE
    114  *
    115  *  4.2.4 Get User Name, P1003.1b-1993, p. 87
    116  *
    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 /*PAGE
    129  *
    130  *  4.2.4 Get User Name, P1003.1b-1993, p. 87
    131  *
    132  *  NOTE:  P1003.1c/D10, p. 49 adds getlogin_r().
    133  */
    134 
    135 int getlogin_r(
    136   char   *name,
    137   size_t  namesize
    138 )
    139 {
    140   if ( namesize < LOGIN_NAME_MAX )
    141     return ERANGE;
    142 
    143   strcpy( name, "posixapp" );
    144   return 0;
    145 }
    146 
    147 /*PAGE
    148  *
    149  *  4.3.1 Get Process Group IDs, P1003.1b-1993, p. 89
    150  */
    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 /*PAGE
    163  *
    164  *  4.3.2 Create Session and Set Process Group ID, P1003.1b-1993, p. 88
    165  */
    166 
    167 pid_t setsid( void )
    168 {
    169   set_errno_and_return_minus_one( ENOSYS );
    170 }
    171 
    172 /*PAGE
    173  *
    174  *  4.3.3 Set Process Group ID for Job Control, P1003.1b-1993, p. 89
    175  */
    176 
    177 int setpgid(
    178   pid_t  pid,
    179   pid_t  pgid
    180 )
    181 {
    182   set_errno_and_return_minus_one( ENOSYS );
    183 }
    18415
    18516/*
Note: See TracChangeset for help on using the changeset viewer.