* cygwin.din: Export rand_r and ttyname_r.
* syscalls.cc (ttyname_r): New function. (ttyname): Move functionality to ttyname_r. Call it from here. * include/cygwin/version.h: Bump API minor number.
This commit is contained in:
parent
b923181eca
commit
93d66ddc20
@ -1,11 +1,18 @@
|
|||||||
|
2004-04-14 Corinna Vinschen <corinna@vinschen.de>
|
||||||
|
|
||||||
|
* cygwin.din: Export rand_r and ttyname_r.
|
||||||
|
* syscalls.cc (ttyname_r): New function.
|
||||||
|
(ttyname): Move functionality to ttyname_r. Call it from here.
|
||||||
|
* include/cygwin/version.h: Bump API minor number.
|
||||||
|
|
||||||
2004-04-14 Pierre Humblet <pierre.humblet@ieee.org>
|
2004-04-14 Pierre Humblet <pierre.humblet@ieee.org>
|
||||||
|
|
||||||
* path.h (path_conv::set_symlink): Add argument.
|
* path.h (path_conv::set_symlink): Add argument.
|
||||||
(path_conv::get_symlink_length): New method.
|
(path_conv::get_symlink_length): New method.
|
||||||
(path_conv::symlink_length): New member.
|
(path_conv::symlink_length): New member.
|
||||||
* path.cc (path_conv::check): Pass symlen to set_symlink.
|
* path.cc (path_conv::check): Pass symlen to set_symlink.
|
||||||
* fhandler_disk_file.cc (fhandler_base::fstat_helper): For symlinks
|
* fhandler_disk_file.cc (fhandler_base::fstat_helper): For symlinks
|
||||||
set st_size from get_symlink_length.
|
set st_size from get_symlink_length.
|
||||||
|
|
||||||
2004-04-13 Corinna Vinschen <corinna@vinschen.de>
|
2004-04-13 Corinna Vinschen <corinna@vinschen.de>
|
||||||
|
|
||||||
|
@ -1067,6 +1067,7 @@ raise SIGFE
|
|||||||
_raise = raise SIGFE
|
_raise = raise SIGFE
|
||||||
rand NOSIGFE
|
rand NOSIGFE
|
||||||
_rand = rand NOSIGFE
|
_rand = rand NOSIGFE
|
||||||
|
rand_r NOSIGFE
|
||||||
random NOSIGFE
|
random NOSIGFE
|
||||||
read SIGFE
|
read SIGFE
|
||||||
_read = read SIGFE
|
_read = read SIGFE
|
||||||
@ -1438,6 +1439,7 @@ truncf NOSIGFE
|
|||||||
tsearch SIGFE
|
tsearch SIGFE
|
||||||
ttyname SIGFE
|
ttyname SIGFE
|
||||||
_ttyname = ttyname SIGFE
|
_ttyname = ttyname SIGFE
|
||||||
|
ttyname_r SIGFE
|
||||||
ttyslot NOSIGFE
|
ttyslot NOSIGFE
|
||||||
twalk NOSIGFE
|
twalk NOSIGFE
|
||||||
tzset SIGFE
|
tzset SIGFE
|
||||||
|
@ -240,12 +240,13 @@ details. */
|
|||||||
112: Redefine some mtget fields.
|
112: Redefine some mtget fields.
|
||||||
113: Again redefine some mtget fields. Use mt_fileno and mt_blkno as
|
113: Again redefine some mtget fields. Use mt_fileno and mt_blkno as
|
||||||
on Linux.
|
on Linux.
|
||||||
|
114: Export rand_r, ttyname_r.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
/* Note that we forgot to bump the api for ualarm, strtoll, strtoull */
|
/* Note that we forgot to bump the api for ualarm, strtoll, strtoull */
|
||||||
|
|
||||||
#define CYGWIN_VERSION_API_MAJOR 0
|
#define CYGWIN_VERSION_API_MAJOR 0
|
||||||
#define CYGWIN_VERSION_API_MINOR 113
|
#define CYGWIN_VERSION_API_MINOR 114
|
||||||
|
|
||||||
/* There is also a compatibity version number associated with the
|
/* There is also a compatibity version number associated with the
|
||||||
shared memory regions. It is incremented when incompatible
|
shared memory regions. It is incremented when incompatible
|
||||||
|
@ -1511,15 +1511,38 @@ pathconf (const char *file, int v)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
extern "C" int
|
||||||
|
ttyname_r (int fd, char *buf, size_t buflen)
|
||||||
|
{
|
||||||
|
int ret = 0;
|
||||||
|
if (__check_null_invalid_struct (buf, buflen))
|
||||||
|
ret = EINVAL;
|
||||||
|
else
|
||||||
|
{
|
||||||
|
cygheap_fdget cfd (fd, true);
|
||||||
|
if (cfd < 0)
|
||||||
|
ret = EBADF;
|
||||||
|
else if (!cfd->is_tty ())
|
||||||
|
ret = ENOTTY;
|
||||||
|
else if (buflen < strlen (cfd->ttyname ()) + 1)
|
||||||
|
ret = ERANGE;
|
||||||
|
else
|
||||||
|
strcpy (buf, cfd->ttyname ());
|
||||||
|
}
|
||||||
|
debug_printf ("returning %d tty: %s", ret, ret ? "NULL" : buf);
|
||||||
|
return ret;
|
||||||
|
}
|
||||||
|
|
||||||
extern "C" char *
|
extern "C" char *
|
||||||
ttyname (int fd)
|
ttyname (int fd)
|
||||||
{
|
{
|
||||||
char *name;
|
static char name[CYG_MAX_PATH];
|
||||||
cygheap_fdget cfd (fd);
|
int ret = ttyname_r (fd, name, CYG_MAX_PATH);
|
||||||
if (cfd < 0 || !cfd->is_tty ())
|
if (ret)
|
||||||
return 0;
|
{
|
||||||
name = (char *) (cfd->ttyname ());
|
set_errno (ret);
|
||||||
debug_printf ("returning %s", name);
|
return NULL;
|
||||||
|
}
|
||||||
return name;
|
return name;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user