diff options
author | Ron Yorston <rmy@pobox.com> | 2015-02-27 15:00:55 +0000 |
---|---|---|
committer | Ron Yorston <rmy@pobox.com> | 2015-02-27 15:00:55 +0000 |
commit | 939a8e932851124e05f14df53a925b185054b5ae (patch) | |
tree | f40c7d43e8b8bdd30228fa00e68b8ac8d519465b | |
parent | 59abbf391be4ddaab0e0335b4f3691cc48590574 (diff) | |
download | busybox-w32-939a8e932851124e05f14df53a925b185054b5ae.tar.gz busybox-w32-939a8e932851124e05f14df53a925b185054b5ae.tar.bz2 busybox-w32-939a8e932851124e05f14df53a925b185054b5ae.zip |
Enable logname in mingw32 configuration
-rw-r--r-- | configs/mingw32_defconfig | 6 | ||||
-rw-r--r-- | include/mingw.h | 1 | ||||
-rw-r--r-- | win32/mingw.c | 17 |
3 files changed, 21 insertions, 3 deletions
diff --git a/configs/mingw32_defconfig b/configs/mingw32_defconfig index 4a3303b9e..cff601e72 100644 --- a/configs/mingw32_defconfig +++ b/configs/mingw32_defconfig | |||
@@ -1,7 +1,7 @@ | |||
1 | # | 1 | # |
2 | # Automatically generated make config: don't edit | 2 | # Automatically generated make config: don't edit |
3 | # Busybox version: 1.23.0-TIG-1656-g6d6d18d | 3 | # Busybox version: 1.23.0 |
4 | # Sun Dec 14 14:24:44 2014 | 4 | # Fri Feb 27 14:51:19 2015 |
5 | # | 5 | # |
6 | CONFIG_HAVE_DOT_CONFIG=y | 6 | CONFIG_HAVE_DOT_CONFIG=y |
7 | # CONFIG_PLATFORM_POSIX is not set | 7 | # CONFIG_PLATFORM_POSIX is not set |
@@ -241,7 +241,7 @@ CONFIG_FEATURE_FANCY_HEAD=y | |||
241 | # CONFIG_INSTALL is not set | 241 | # CONFIG_INSTALL is not set |
242 | # CONFIG_FEATURE_INSTALL_LONG_OPTIONS is not set | 242 | # CONFIG_FEATURE_INSTALL_LONG_OPTIONS is not set |
243 | # CONFIG_LN is not set | 243 | # CONFIG_LN is not set |
244 | # CONFIG_LOGNAME is not set | 244 | CONFIG_LOGNAME=y |
245 | CONFIG_LS=y | 245 | CONFIG_LS=y |
246 | CONFIG_FEATURE_LS_FILETYPES=y | 246 | CONFIG_FEATURE_LS_FILETYPES=y |
247 | CONFIG_FEATURE_LS_FOLLOWLINKS=y | 247 | CONFIG_FEATURE_LS_FOLLOWLINKS=y |
diff --git a/include/mingw.h b/include/mingw.h index 970b689fd..033edd07e 100644 --- a/include/mingw.h +++ b/include/mingw.h | |||
@@ -371,6 +371,7 @@ IMPL(getegid,int,DEFAULT_GID,void); | |||
371 | IMPL(geteuid,int,DEFAULT_UID,void); | 371 | IMPL(geteuid,int,DEFAULT_UID,void); |
372 | NOIMPL(getsid,pid_t pid UNUSED_PARAM); | 372 | NOIMPL(getsid,pid_t pid UNUSED_PARAM); |
373 | IMPL(getuid,int,DEFAULT_UID,void); | 373 | IMPL(getuid,int,DEFAULT_UID,void); |
374 | int getlogin_r(char *buf, size_t len); | ||
374 | int fcntl(int fd, int cmd, ...); | 375 | int fcntl(int fd, int cmd, ...); |
375 | #define fork() -1 | 376 | #define fork() -1 |
376 | IMPL(fsync,int,0,int fd UNUSED_PARAM); | 377 | IMPL(fsync,int,0,int fd UNUSED_PARAM); |
diff --git a/win32/mingw.c b/win32/mingw.c index 197f331f6..4b5701b2d 100644 --- a/win32/mingw.c +++ b/win32/mingw.c | |||
@@ -624,6 +624,23 @@ struct group *getgrgid(gid_t gid UNUSED_PARAM) | |||
624 | return &g; | 624 | return &g; |
625 | } | 625 | } |
626 | 626 | ||
627 | int getlogin_r(char *buf, size_t len) | ||
628 | { | ||
629 | char *name; | ||
630 | |||
631 | if ( (name=get_user_name()) == NULL ) { | ||
632 | return -1; | ||
633 | } | ||
634 | |||
635 | if ( strlen(name) >= len ) { | ||
636 | errno = ERANGE; | ||
637 | return -1; | ||
638 | } | ||
639 | |||
640 | strcpy(buf, name); | ||
641 | return 0; | ||
642 | } | ||
643 | |||
627 | long sysconf(int name) | 644 | long sysconf(int name) |
628 | { | 645 | { |
629 | if ( name == _SC_CLK_TCK ) { | 646 | if ( name == _SC_CLK_TCK ) { |