diff options
author | Corinna Vinschen <corinna@vinschen.de> | 2004-05-17 20:06:02 +0400 |
---|---|---|
committer | Corinna Vinschen <corinna@vinschen.de> | 2004-05-17 20:06:02 +0400 |
commit | 68509b303eb9d091068adf651385c29c41a8f458 (patch) | |
tree | 39b0c6a04fe2571166c8a9025bb0973858429e03 /winsup/cygwin/uinfo.cc | |
parent | 3271e9f9e38cb9d0e51554680f1f87c3ea3fe5f7 (diff) |
* cygwin.din: Add symbols flockfile, ftrylockfile, funlockfile,
getgrgid_r, getgrnam_r and getlogin_r.
* grp.cc (getgrgid_r): New function.
(getgrnam_r): Ditto.
* syscalls.cc (flockfile): Ditto.
(ftrylockfile): Ditto.
(funlockfile): Ditto.
* sysconf.cc (sysconf): Return LOGIN_NAME_MAX in case of
_SC_LOGIN_NAME_MAX.
* thread.cc (__cygwin_lock_trylock): Define int. Return value from
call to pthread_mutex_trylock.
* uinfo.cc (getlogin_r): New function.
* include/limits.h: Define LOGIN_NAME_MAX.
* include/cygwin/version.h: Bump API minor number.
* include/sys/lock.h: Add declarations for __cygwin_lock_xxx functions.
* include/sys/stdio.h: Add define for _ftrylockfile.
Diffstat (limited to 'winsup/cygwin/uinfo.cc')
-rw-r--r-- | winsup/cygwin/uinfo.cc | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/winsup/cygwin/uinfo.cc b/winsup/cygwin/uinfo.cc index 231347e1f..2bf164ff6 100644 --- a/winsup/cygwin/uinfo.cc +++ b/winsup/cygwin/uinfo.cc @@ -166,6 +166,20 @@ uinfo_init () cygheap->user.set_saved_sid (); /* Update the original sid */ } +extern "C" int +getlogin_r (char *name, size_t namesize) +{ + char *login = getlogin (); + size_t len = strlen (login) + 1; + if (len > namesize) + return ERANGE; + int err = __check_null_invalid_struct (name, len); + if (err) + return err; + strncpy (name, login, len); + return 0; +} + extern "C" char * getlogin (void) { |