Welcome to mirror list, hosted at ThFree Co, Russian Federation.

cygwin.com/git/newlib-cygwin.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCorinna Vinschen <corinna@vinschen.de>2003-11-17 20:25:59 +0300
committerCorinna Vinschen <corinna@vinschen.de>2003-11-17 20:25:59 +0300
commit6e17cee57bae7447ee61a14e77bfe41f6efc8cdd (patch)
tree8e3e746d56deb8402663a9d5a27edcf8acf4fc3e /winsup/cygwin
parent490d129f4ad49dd6682bc424a067a96cb4473a21 (diff)
* bsdlib.cc (getprogname): New function.
(setprogname): New funtion. * cygwin.din: Export getprogname and setprogname. * include/cygwin/version.h: Bumb API version number.
Diffstat (limited to 'winsup/cygwin')
-rw-r--r--winsup/cygwin/ChangeLog7
-rw-r--r--winsup/cygwin/cygwin.din2
-rw-r--r--winsup/cygwin/include/cygwin/version.h3
-rw-r--r--winsup/cygwin/libc/bsdlib.cc22
4 files changed, 33 insertions, 1 deletions
diff --git a/winsup/cygwin/ChangeLog b/winsup/cygwin/ChangeLog
index f70628af6..c3fe0a05b 100644
--- a/winsup/cygwin/ChangeLog
+++ b/winsup/cygwin/ChangeLog
@@ -1,3 +1,10 @@
+2003-11-17 Corinna Vinschen <corinna@vinschen.de>
+
+ * bsdlib.cc (getprogname): New function.
+ (setprogname): New funtion.
+ * cygwin.din: Export getprogname and setprogname.
+ * include/cygwin/version.h: Bumb API version number.
+
2003-11-15 Christopher Faylor <cgf@redhat.com>
* include/limits.h: Revert unsanctioned changes below.
diff --git a/winsup/cygwin/cygwin.din b/winsup/cygwin/cygwin.din
index 3a2e957f4..62b152210 100644
--- a/winsup/cygwin/cygwin.din
+++ b/winsup/cygwin/cygwin.din
@@ -645,6 +645,7 @@ getpid
_getpid = getpid
getppid
_getppid = getppid
+getprogname
getpwduid
_getpwduid = getpwduid
getpwent
@@ -1178,6 +1179,7 @@ setpgid
_setpgid = setpgid
setpgrp
_setpgrp = setpgrp
+setprogname
setpwent
_setpwent = setpwent
setregid
diff --git a/winsup/cygwin/include/cygwin/version.h b/winsup/cygwin/include/cygwin/version.h
index 3a39c2367..24b9eb62a 100644
--- a/winsup/cygwin/include/cygwin/version.h
+++ b/winsup/cygwin/include/cygwin/version.h
@@ -227,13 +227,14 @@ details. */
100: CW_GET_SHMLBA addition to external.cc.
101: Export err, errx, verr, verrx, warn, warnx, vwarn, vwarnx.
102: CW_GET_UID_FROM_SID and CW_GET_GID_FROM_SID addition to external.cc.
+ 103: Export getprogname, setprogname.
*/
/* Note that we forgot to bump the api for ualarm, strtoll, strtoull */
#define CYGWIN_VERSION_API_MAJOR 0
-#define CYGWIN_VERSION_API_MINOR 102
+#define CYGWIN_VERSION_API_MINOR 103
/* There is also a compatibity version number associated with the
shared memory regions. It is incremented when incompatible
diff --git a/winsup/cygwin/libc/bsdlib.cc b/winsup/cygwin/libc/bsdlib.cc
index 0fad8525c..b0f8dbbad 100644
--- a/winsup/cygwin/libc/bsdlib.cc
+++ b/winsup/cygwin/libc/bsdlib.cc
@@ -236,3 +236,25 @@ errx (int eval, const char *fmt, ...)
vwarnx (fmt, ap);
exit (eval);
}
+
+extern "C" const char *
+getprogname (void)
+{
+ return __progname;
+}
+
+extern "C" void
+setprogname (const char *newprogname)
+{
+ if (!check_null_str_errno (newprogname))
+ {
+ /* Per BSD man page, setprogname keeps a pointer to the last
+ path component of the argument. It does *not* copy the
+ argument before. */
+ __progname = strrchr (newprogname, '/');
+ if (__progname)
+ ++__progname;
+ else
+ __progname = (char *)newprogname;
+ }
+}