summaryrefslogtreecommitdiff
path: root/sysdeps/generic
diff options
context:
space:
mode:
Diffstat (limited to 'sysdeps/generic')
-rw-r--r--sysdeps/generic/pty.c10
-rw-r--r--sysdeps/generic/sys/ucontext.h24
2 files changed, 32 insertions, 2 deletions
diff --git a/sysdeps/generic/pty.c b/sysdeps/generic/pty.c
index 660602b25a..75c7857f47 100644
--- a/sysdeps/generic/pty.c
+++ b/sysdeps/generic/pty.c
@@ -49,6 +49,10 @@ static char sccsid[] = "@(#)pty.c 8.1 (Berkeley) 6/4/93";
#include <pty.h>
#include <utmp.h>
+#ifndef REVOKE
+# define REVOKE(Line) revoke (Line)
+#endif
+
int
openpty(amaster, aslave, name, termp, winp)
int *amaster, *aslave;
@@ -56,7 +60,7 @@ openpty(amaster, aslave, name, termp, winp)
struct termios *termp;
struct winsize *winp;
{
- static char line[] = "/dev/ptyXX";
+ char line[11];
register const char *cp1, *cp2;
register int master, slave, ttygid;
size_t buflen = sysconf (_SC_GETGR_R_SIZE_MAX);
@@ -64,6 +68,8 @@ openpty(amaster, aslave, name, termp, winp)
struct group grbuffer;
struct group *gr;
+ strcpy (line, "/dev/ptyXX");
+
if (getgrnam_r("tty", &grbuffer, buffer, buflen, &gr) >= 0)
ttygid = gr->gr_gid;
else
@@ -80,7 +86,7 @@ openpty(amaster, aslave, name, termp, winp)
line[5] = 't';
(void) chown(line, getuid(), ttygid);
(void) chmod(line, S_IRUSR|S_IWUSR|S_IWGRP);
- (void) revoke(line);
+ REVOKE(line);
if ((slave = open(line, O_RDWR, 0)) != -1) {
*amaster = master;
*aslave = slave;
diff --git a/sysdeps/generic/sys/ucontext.h b/sysdeps/generic/sys/ucontext.h
new file mode 100644
index 0000000000..cdfeb2cb81
--- /dev/null
+++ b/sysdeps/generic/sys/ucontext.h
@@ -0,0 +1,24 @@
+/* Copyright (C) 1997 Free Software Foundation, Inc.
+ This file is part of the GNU C Library.
+
+ The GNU C Library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Library General Public License as
+ published by the Free Software Foundation; either version 2 of the
+ License, or (at your option) any later version.
+
+ The GNU C Library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Library General Public License for more details.
+
+ You should have received a copy of the GNU Library General Public
+ License along with the GNU C Library; see the file COPYING.LIB. If not,
+ write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
+ Boston, MA 02111-1307, USA. */
+
+#ifndef _SYS_UCONTEXT_H
+#define _SYS_UCONTEXT_H 1
+
+#error "No system dependent context structure definitions"
+
+#endif /* sys/ucontext.h */