OSDN Git Service

mksysinfo: Fix for systems that don't define TIOCSCTTY.
authorian <ian@138bc75d-0d04-0410-961f-82ee72b054a4>
Tue, 27 Sep 2011 13:16:22 +0000 (13:16 +0000)
committerian <ian@138bc75d-0d04-0410-961f-82ee72b054a4>
Tue, 27 Sep 2011 13:16:22 +0000 (13:16 +0000)
From Rainer Orth.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@179269 138bc75d-0d04-0410-961f-82ee72b054a4

libgo/mksysinfo.sh

index 2b5acd6..85dd33c 100755 (executable)
@@ -499,6 +499,14 @@ grep '^type _passwd ' gen-sysinfo.go | \
 grep '^const _TIOC' gen-sysinfo.go | \
     sed -e 's/^\(const \)_\(TIOC[^= ]*\)\(.*\)$/\1\2 = _\2/' >> ${OUT}
 
 grep '^const _TIOC' gen-sysinfo.go | \
     sed -e 's/^\(const \)_\(TIOC[^= ]*\)\(.*\)$/\1\2 = _\2/' >> ${OUT}
 
+# ioctl constants.  Might fall back to 0 if TIOCNXCL is missing, too, but
+# needs handling in syscalls.exec.go.
+if ! grep '^const _TIOCSCTTY ' gen-sysinfo.go >/dev/null 2>&1; then
+  if grep '^const _TIOCNXCL ' gen-sysinfo.go >/dev/null 2>&1; then
+    echo "const TIOCSCTTY = TIOCNXCL" >> ${OUT}
+  fi
+fi
+
 # The nlmsghdr struct.
 grep '^type _nlmsghdr ' gen-sysinfo.go | \
     sed -e 's/_nlmsghdr/NlMsghdr/' \
 # The nlmsghdr struct.
 grep '^type _nlmsghdr ' gen-sysinfo.go | \
     sed -e 's/_nlmsghdr/NlMsghdr/' \