Split types.s into individual files.

This commit is contained in:
Joel Sherrill
1999-11-02 19:24:38 +00:00
parent 07e07437c4
commit 811fae12e9
23 changed files with 608 additions and 343 deletions

View File

@@ -30,6 +30,9 @@ CONDITION_VARIABLE_C_PIECES= cond condattrdestroy condattrgetpshared \
conddestroy condinit condmp condsignal condsignalsupp condtimedwait \
condwait condwaitsupp
ID_C_PIECES= getegid geteuid getgid getgroups getlogin getpgrp getpid getppid \
getuid setpgid setsid
KEY_C_PIECES= key keycreate keydelete keygetspecific keyrundestructors \
keysetspecific
@@ -78,7 +81,7 @@ TIME_C_PIECES= time posixtimespecsubtract posixtimespectointerval \
TIMER_C_PIECES=ptimer ptimer1
C_PIECES = adasupp $(CANCEL_C_PIECES) $(CONDITION_VARIABLE_C_PIECES) \
getpid $(KEY_C_PIECES) $(MESSAGE_QUEUE_C_PIECES) \
$(ID_C_PIECES) $(KEY_C_PIECES) $(MESSAGE_QUEUE_C_PIECES) \
$(MUTEX_C_PIECES) $(PTHREAD_C_PIECES) \
$(PSIGNAL_C_PIECES) sched $(SEMAPHORE_C_PIECES) \
$(TIME_C_PIECES) $(TIMER_C_PIECES) types unistd $(ENOSYS_C_PIECES) \

View File

@@ -0,0 +1,26 @@
/*
* $Id$
*/
#include <limits.h>
#include <errno.h>
#include <string.h>
#include <sys/types.h>
#include <rtems/system.h>
#include <rtems/score/object.h>
#include <rtems/posix/seterr.h>
gid_t _POSIX_types_Egid = 0;
/*PAGE
*
* 4.2.1 Get Real User, Effective User, Ral Group, and Effective Group IDs,
* P1003.1b-1993, p. 84
*/
gid_t getegid( void )
{
return _POSIX_types_Egid;
}

View File

@@ -0,0 +1,25 @@
/*
* $Id$
*/
#include <limits.h>
#include <errno.h>
#include <string.h>
#include <sys/types.h>
#include <rtems/system.h>
#include <rtems/score/object.h>
#include <rtems/posix/seterr.h>
uid_t _POSIX_types_Euid = 0;
/*PAGE
*
* 4.2.1 Get Real User, Effective User, Ral Group, and Effective Group IDs,
* P1003.1b-1993, p. 84
*/
uid_t geteuid( void )
{
return _POSIX_types_Euid;
}

View File

@@ -0,0 +1,38 @@
/*
* $Id$
*/
#include <limits.h>
#include <errno.h>
#include <string.h>
#include <sys/types.h>
#include <rtems/system.h>
#include <rtems/score/object.h>
#include <rtems/posix/seterr.h>
gid_t _POSIX_types_Gid = 0;
/*PAGE
*
* 4.2.1 Get Real User, Effective User, Ral Group, and Effective Group IDs,
* P1003.1b-1993, p. 84
*/
gid_t getgid( void )
{
return _POSIX_types_Gid;
}
/*PAGE
*
* 4.2.2 Set User and Group IDs, P1003.1b-1993, p. 84
*/
int setgid(
gid_t gid
)
{
_POSIX_types_Gid = gid;
return 0;
}

View File

@@ -0,0 +1,26 @@
/*
* $Id$
*/
#include <limits.h>
#include <errno.h>
#include <string.h>
#include <sys/types.h>
#include <rtems/system.h>
#include <rtems/score/object.h>
#include <rtems/posix/seterr.h>
/*PAGE
*
* 4.2.3 Get Supplementary IDs, P1003.1b-1993, p. 86
*/
int getgroups(
int gidsetsize,
gid_t grouplist[]
)
{
return 0; /* no supplemental group ids */
}

View File

@@ -0,0 +1,46 @@
/*
* $Id$
*/
#include <limits.h>
#include <errno.h>
#include <string.h>
#include <sys/types.h>
#include <rtems/system.h>
#include <rtems/score/object.h>
#include <rtems/posix/seterr.h>
/*PAGE
*
* 4.2.4 Get User Name, P1003.1b-1993, p. 87
*
* NOTE: P1003.1c/D10, p. 49 adds getlogin_r().
*/
static char _POSIX_types_Getlogin_buffer[ LOGIN_NAME_MAX ];
char *getlogin( void )
{
(void) getlogin_r( _POSIX_types_Getlogin_buffer, LOGIN_NAME_MAX );
return _POSIX_types_Getlogin_buffer;
}
/*PAGE
*
* 4.2.4 Get User Name, P1003.1b-1993, p. 87
*
* NOTE: P1003.1c/D10, p. 49 adds getlogin_r().
*/
int getlogin_r(
char *name,
size_t namesize
)
{
if ( namesize < LOGIN_NAME_MAX )
return ERANGE;
strcpy( name, "posixapp" );
return 0;
}

View File

@@ -0,0 +1,27 @@
/*
* $Id$
*/
#include <limits.h>
#include <errno.h>
#include <string.h>
#include <sys/types.h>
#include <rtems/system.h>
#include <rtems/score/object.h>
#include <rtems/posix/seterr.h>
/*PAGE
*
* 4.3.1 Get Process Group IDs, P1003.1b-1993, p. 89
*/
pid_t getpgrp( void )
{
/*
* This always succeeds and returns the process group id. For rtems,
* this will always be the local node;
*/
return _Objects_Local_node;
}

View File

@@ -0,0 +1,25 @@
/*
* $Id$
*/
#include <limits.h>
#include <errno.h>
#include <string.h>
#include <sys/types.h>
#include <rtems/system.h>
#include <rtems/score/object.h>
#include <rtems/posix/seterr.h>
pid_t _POSIX_types_Ppid = 0;
/*PAGE
*
* 4.1.1 Get Process and Parent Process IDs, P1003.1b-1993, p. 83
*/
pid_t getppid( void )
{
return _POSIX_types_Ppid;
}

View File

@@ -0,0 +1,38 @@
/*
* $Id$
*/
#include <limits.h>
#include <errno.h>
#include <string.h>
#include <sys/types.h>
#include <rtems/system.h>
#include <rtems/score/object.h>
#include <rtems/posix/seterr.h>
uid_t _POSIX_types_Uid = 0;
/*PAGE
*
* 4.2.1 Get Real User, Effective User, Ral Group, and Effective Group IDs,
* P1003.1b-1993, p. 84
*/
uid_t getuid( void )
{
return _POSIX_types_Uid;
}
/*PAGE
*
* 4.2.2 Set User and Group IDs, P1003.1b-1993, p. 84
*/
int setuid(
uid_t uid
)
{
_POSIX_types_Uid = uid;
return 0;
}

View File

@@ -0,0 +1,25 @@
/*
* $Id$
*/
#include <limits.h>
#include <errno.h>
#include <string.h>
#include <sys/types.h>
#include <rtems/system.h>
#include <rtems/score/object.h>
#include <rtems/posix/seterr.h>
/*PAGE
*
* 4.3.3 Set Process Group ID for Job Control, P1003.1b-1993, p. 89
*/
int setpgid(
pid_t pid,
pid_t pgid
)
{
set_errno_and_return_minus_one( ENOSYS );
}

View File

@@ -0,0 +1,24 @@
/*
* $Id$
*/
#include <limits.h>
#include <errno.h>
#include <string.h>
#include <sys/types.h>
#include <rtems/system.h>
#include <rtems/score/object.h>
#include <rtems/posix/seterr.h>
/*PAGE
*
* 4.3.2 Create Session and Set Process Group ID, P1003.1b-1993, p. 88
*/
pid_t setsid( void )
{
set_errno_and_return_minus_one( ENOSYS );
}

View File

@@ -1,4 +1,6 @@
/*
* This file is the shell of what it initially was and is now misnamed.
*
* $Id$
*/
@@ -11,177 +13,6 @@
#include <rtems/score/object.h>
#include <rtems/posix/seterr.h>
pid_t _POSIX_types_Ppid = 0;
uid_t _POSIX_types_Uid = 0;
uid_t _POSIX_types_Euid = 0;
gid_t _POSIX_types_Gid = 0;
gid_t _POSIX_types_Egid = 0;
/*PAGE
*
* 4.1.1 Get Process and Parent Process IDs, P1003.1b-1993, p. 83
*/
pid_t getppid( void )
{
return _POSIX_types_Ppid;
}
/*PAGE
*
* 4.2.1 Get Real User, Effective User, Ral Group, and Effective Group IDs,
* P1003.1b-1993, p. 84
*/
uid_t getuid( void )
{
return _POSIX_types_Uid;
}
/*PAGE
*
* 4.2.1 Get Real User, Effective User, Ral Group, and Effective Group IDs,
* P1003.1b-1993, p. 84
*/
uid_t geteuid( void )
{
return _POSIX_types_Euid;
}
/*PAGE
*
* 4.2.1 Get Real User, Effective User, Ral Group, and Effective Group IDs,
* P1003.1b-1993, p. 84
*/
gid_t getgid( void )
{
return _POSIX_types_Gid;
}
/*PAGE
*
* 4.2.1 Get Real User, Effective User, Ral Group, and Effective Group IDs,
* P1003.1b-1993, p. 84
*/
gid_t getegid( void )
{
return _POSIX_types_Egid;
}
/*PAGE
*
* 4.2.2 Set User and Group IDs, P1003.1b-1993, p. 84
*/
int setuid(
uid_t uid
)
{
_POSIX_types_Uid = uid;
return 0;
}
/*PAGE
*
* 4.2.2 Set User and Group IDs, P1003.1b-1993, p. 84
*/
int setgid(
gid_t gid
)
{
_POSIX_types_Gid = gid;
return 0;
}
/*PAGE
*
* 4.2.3 Get Supplementary IDs, P1003.1b-1993, p. 86
*/
int getgroups(
int gidsetsize,
gid_t grouplist[]
)
{
return 0; /* no supplemental group ids */
}
/*PAGE
*
* 4.2.4 Get User Name, P1003.1b-1993, p. 87
*
* NOTE: P1003.1c/D10, p. 49 adds getlogin_r().
*/
static char _POSIX_types_Getlogin_buffer[ LOGIN_NAME_MAX ];
char *getlogin( void )
{
(void) getlogin_r( _POSIX_types_Getlogin_buffer, LOGIN_NAME_MAX );
return _POSIX_types_Getlogin_buffer;
}
/*PAGE
*
* 4.2.4 Get User Name, P1003.1b-1993, p. 87
*
* NOTE: P1003.1c/D10, p. 49 adds getlogin_r().
*/
int getlogin_r(
char *name,
size_t namesize
)
{
if ( namesize < LOGIN_NAME_MAX )
return ERANGE;
strcpy( name, "posixapp" );
return 0;
}
/*PAGE
*
* 4.3.1 Get Process Group IDs, P1003.1b-1993, p. 89
*/
pid_t getpgrp( void )
{
/*
* This always succeeds and returns the process group id. For rtems,
* this will always be the local node;
*/
return _Objects_Local_node;
}
/*PAGE
*
* 4.3.2 Create Session and Set Process Group ID, P1003.1b-1993, p. 88
*/
pid_t setsid( void )
{
set_errno_and_return_minus_one( ENOSYS );
}
/*PAGE
*
* 4.3.3 Set Process Group ID for Job Control, P1003.1b-1993, p. 89
*/
int setpgid(
pid_t pid,
pid_t pgid
)
{
set_errno_and_return_minus_one( ENOSYS );
}
/*
* TEMPORARY
*/

View File

@@ -0,0 +1,26 @@
/*
* $Id$
*/
#include <limits.h>
#include <errno.h>
#include <string.h>
#include <sys/types.h>
#include <rtems/system.h>
#include <rtems/score/object.h>
#include <rtems/posix/seterr.h>
gid_t _POSIX_types_Egid = 0;
/*PAGE
*
* 4.2.1 Get Real User, Effective User, Ral Group, and Effective Group IDs,
* P1003.1b-1993, p. 84
*/
gid_t getegid( void )
{
return _POSIX_types_Egid;
}

View File

@@ -0,0 +1,25 @@
/*
* $Id$
*/
#include <limits.h>
#include <errno.h>
#include <string.h>
#include <sys/types.h>
#include <rtems/system.h>
#include <rtems/score/object.h>
#include <rtems/posix/seterr.h>
uid_t _POSIX_types_Euid = 0;
/*PAGE
*
* 4.2.1 Get Real User, Effective User, Ral Group, and Effective Group IDs,
* P1003.1b-1993, p. 84
*/
uid_t geteuid( void )
{
return _POSIX_types_Euid;
}

38
cpukit/posix/src/getgid.c Normal file
View File

@@ -0,0 +1,38 @@
/*
* $Id$
*/
#include <limits.h>
#include <errno.h>
#include <string.h>
#include <sys/types.h>
#include <rtems/system.h>
#include <rtems/score/object.h>
#include <rtems/posix/seterr.h>
gid_t _POSIX_types_Gid = 0;
/*PAGE
*
* 4.2.1 Get Real User, Effective User, Ral Group, and Effective Group IDs,
* P1003.1b-1993, p. 84
*/
gid_t getgid( void )
{
return _POSIX_types_Gid;
}
/*PAGE
*
* 4.2.2 Set User and Group IDs, P1003.1b-1993, p. 84
*/
int setgid(
gid_t gid
)
{
_POSIX_types_Gid = gid;
return 0;
}

View File

@@ -0,0 +1,26 @@
/*
* $Id$
*/
#include <limits.h>
#include <errno.h>
#include <string.h>
#include <sys/types.h>
#include <rtems/system.h>
#include <rtems/score/object.h>
#include <rtems/posix/seterr.h>
/*PAGE
*
* 4.2.3 Get Supplementary IDs, P1003.1b-1993, p. 86
*/
int getgroups(
int gidsetsize,
gid_t grouplist[]
)
{
return 0; /* no supplemental group ids */
}

View File

@@ -0,0 +1,46 @@
/*
* $Id$
*/
#include <limits.h>
#include <errno.h>
#include <string.h>
#include <sys/types.h>
#include <rtems/system.h>
#include <rtems/score/object.h>
#include <rtems/posix/seterr.h>
/*PAGE
*
* 4.2.4 Get User Name, P1003.1b-1993, p. 87
*
* NOTE: P1003.1c/D10, p. 49 adds getlogin_r().
*/
static char _POSIX_types_Getlogin_buffer[ LOGIN_NAME_MAX ];
char *getlogin( void )
{
(void) getlogin_r( _POSIX_types_Getlogin_buffer, LOGIN_NAME_MAX );
return _POSIX_types_Getlogin_buffer;
}
/*PAGE
*
* 4.2.4 Get User Name, P1003.1b-1993, p. 87
*
* NOTE: P1003.1c/D10, p. 49 adds getlogin_r().
*/
int getlogin_r(
char *name,
size_t namesize
)
{
if ( namesize < LOGIN_NAME_MAX )
return ERANGE;
strcpy( name, "posixapp" );
return 0;
}

View File

@@ -0,0 +1,27 @@
/*
* $Id$
*/
#include <limits.h>
#include <errno.h>
#include <string.h>
#include <sys/types.h>
#include <rtems/system.h>
#include <rtems/score/object.h>
#include <rtems/posix/seterr.h>
/*PAGE
*
* 4.3.1 Get Process Group IDs, P1003.1b-1993, p. 89
*/
pid_t getpgrp( void )
{
/*
* This always succeeds and returns the process group id. For rtems,
* this will always be the local node;
*/
return _Objects_Local_node;
}

View File

@@ -0,0 +1,25 @@
/*
* $Id$
*/
#include <limits.h>
#include <errno.h>
#include <string.h>
#include <sys/types.h>
#include <rtems/system.h>
#include <rtems/score/object.h>
#include <rtems/posix/seterr.h>
pid_t _POSIX_types_Ppid = 0;
/*PAGE
*
* 4.1.1 Get Process and Parent Process IDs, P1003.1b-1993, p. 83
*/
pid_t getppid( void )
{
return _POSIX_types_Ppid;
}

38
cpukit/posix/src/getuid.c Normal file
View File

@@ -0,0 +1,38 @@
/*
* $Id$
*/
#include <limits.h>
#include <errno.h>
#include <string.h>
#include <sys/types.h>
#include <rtems/system.h>
#include <rtems/score/object.h>
#include <rtems/posix/seterr.h>
uid_t _POSIX_types_Uid = 0;
/*PAGE
*
* 4.2.1 Get Real User, Effective User, Ral Group, and Effective Group IDs,
* P1003.1b-1993, p. 84
*/
uid_t getuid( void )
{
return _POSIX_types_Uid;
}
/*PAGE
*
* 4.2.2 Set User and Group IDs, P1003.1b-1993, p. 84
*/
int setuid(
uid_t uid
)
{
_POSIX_types_Uid = uid;
return 0;
}

View File

@@ -0,0 +1,25 @@
/*
* $Id$
*/
#include <limits.h>
#include <errno.h>
#include <string.h>
#include <sys/types.h>
#include <rtems/system.h>
#include <rtems/score/object.h>
#include <rtems/posix/seterr.h>
/*PAGE
*
* 4.3.3 Set Process Group ID for Job Control, P1003.1b-1993, p. 89
*/
int setpgid(
pid_t pid,
pid_t pgid
)
{
set_errno_and_return_minus_one( ENOSYS );
}

24
cpukit/posix/src/setsid.c Normal file
View File

@@ -0,0 +1,24 @@
/*
* $Id$
*/
#include <limits.h>
#include <errno.h>
#include <string.h>
#include <sys/types.h>
#include <rtems/system.h>
#include <rtems/score/object.h>
#include <rtems/posix/seterr.h>
/*PAGE
*
* 4.3.2 Create Session and Set Process Group ID, P1003.1b-1993, p. 88
*/
pid_t setsid( void )
{
set_errno_and_return_minus_one( ENOSYS );
}

View File

@@ -1,4 +1,6 @@
/*
* This file is the shell of what it initially was and is now misnamed.
*
* $Id$
*/
@@ -11,177 +13,6 @@
#include <rtems/score/object.h>
#include <rtems/posix/seterr.h>
pid_t _POSIX_types_Ppid = 0;
uid_t _POSIX_types_Uid = 0;
uid_t _POSIX_types_Euid = 0;
gid_t _POSIX_types_Gid = 0;
gid_t _POSIX_types_Egid = 0;
/*PAGE
*
* 4.1.1 Get Process and Parent Process IDs, P1003.1b-1993, p. 83
*/
pid_t getppid( void )
{
return _POSIX_types_Ppid;
}
/*PAGE
*
* 4.2.1 Get Real User, Effective User, Ral Group, and Effective Group IDs,
* P1003.1b-1993, p. 84
*/
uid_t getuid( void )
{
return _POSIX_types_Uid;
}
/*PAGE
*
* 4.2.1 Get Real User, Effective User, Ral Group, and Effective Group IDs,
* P1003.1b-1993, p. 84
*/
uid_t geteuid( void )
{
return _POSIX_types_Euid;
}
/*PAGE
*
* 4.2.1 Get Real User, Effective User, Ral Group, and Effective Group IDs,
* P1003.1b-1993, p. 84
*/
gid_t getgid( void )
{
return _POSIX_types_Gid;
}
/*PAGE
*
* 4.2.1 Get Real User, Effective User, Ral Group, and Effective Group IDs,
* P1003.1b-1993, p. 84
*/
gid_t getegid( void )
{
return _POSIX_types_Egid;
}
/*PAGE
*
* 4.2.2 Set User and Group IDs, P1003.1b-1993, p. 84
*/
int setuid(
uid_t uid
)
{
_POSIX_types_Uid = uid;
return 0;
}
/*PAGE
*
* 4.2.2 Set User and Group IDs, P1003.1b-1993, p. 84
*/
int setgid(
gid_t gid
)
{
_POSIX_types_Gid = gid;
return 0;
}
/*PAGE
*
* 4.2.3 Get Supplementary IDs, P1003.1b-1993, p. 86
*/
int getgroups(
int gidsetsize,
gid_t grouplist[]
)
{
return 0; /* no supplemental group ids */
}
/*PAGE
*
* 4.2.4 Get User Name, P1003.1b-1993, p. 87
*
* NOTE: P1003.1c/D10, p. 49 adds getlogin_r().
*/
static char _POSIX_types_Getlogin_buffer[ LOGIN_NAME_MAX ];
char *getlogin( void )
{
(void) getlogin_r( _POSIX_types_Getlogin_buffer, LOGIN_NAME_MAX );
return _POSIX_types_Getlogin_buffer;
}
/*PAGE
*
* 4.2.4 Get User Name, P1003.1b-1993, p. 87
*
* NOTE: P1003.1c/D10, p. 49 adds getlogin_r().
*/
int getlogin_r(
char *name,
size_t namesize
)
{
if ( namesize < LOGIN_NAME_MAX )
return ERANGE;
strcpy( name, "posixapp" );
return 0;
}
/*PAGE
*
* 4.3.1 Get Process Group IDs, P1003.1b-1993, p. 89
*/
pid_t getpgrp( void )
{
/*
* This always succeeds and returns the process group id. For rtems,
* this will always be the local node;
*/
return _Objects_Local_node;
}
/*PAGE
*
* 4.3.2 Create Session and Set Process Group ID, P1003.1b-1993, p. 88
*/
pid_t setsid( void )
{
set_errno_and_return_minus_one( ENOSYS );
}
/*PAGE
*
* 4.3.3 Set Process Group ID for Job Control, P1003.1b-1993, p. 89
*/
int setpgid(
pid_t pid,
pid_t pgid
)
{
set_errno_and_return_minus_one( ENOSYS );
}
/*
* TEMPORARY
*/