bug-hurd
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: patch8.diff updated Was: Re: GCC's -fsplit-stack disturbing Mach's


From: Samuel Thibault
Subject: Re: patch8.diff updated Was: Re: GCC's -fsplit-stack disturbing Mach's vm_allocate
Date: Wed, 21 May 2014 01:27:04 +0200
User-agent: Mutt/1.5.21+34 (58baf7c9f32f) (2010-12-30)

Svante Signell, le Fri 16 May 2014 10:03:05 +0200, a écrit :
> is used in gcc-4.9-4.9.0/src/libgo/go/net/fd_unix.go:
> func dupCloseOnExec(fd int) (newfd int, err error) {
> if atomic.LoadInt32(&tryDupCloexec) == 1 && syscall.F_DUPFD_CLOEXEC!=0 {
> r0, _, e1 := syscall.Syscall(syscall.SYS_FCNTL, uintptr(fd),
> syscall.F_DUPFD_CLOEXEC, 0)

That code can not work as it is, fcntl is not a system call on
GNU/Hurd. Why isn't gccgo just using the C fcntl function?  That one
will just work and be portable.

> +# Special treatment of EWOULDBLOCK for GNU/Hurd
> +# /usr/include/bits/errno.h: #define EWOULDBLOCK EAGAIN
> +if egrep 'define EWOULDBLOCK EAGAIN' gen-sysinfo.go > /dev/null 2>&1; then
> +  egrep '^const EWOULDBLOCK = Errno(_EWOULDBLOCK)' ${OUT} | \
> +    sed -i.bak -e 's/_EWOULDBLOCK/_EAGAIN/' ${OUT}

I don't understand why you both pass the output of egrep to sed, and you
give the -i option to sed. AIUI, the
egrep '^const EWOULDBLOCK = Errno(_EWOULDBLOCK)'
part is completely unused, so you can just drop it.

> @@ -528,6 +540,12 @@
> +# Special treatment of st_dev for GNU/Hurd
> +# /usr/include/i386-gnu/bits/stat.h: #define st_dev st_fsid
> +if grep 'define st_dev st_fsid' gen-sysinfo.go > /dev/null 2>&1; then
> +  egrep '^type _stat ' gen-sysinfo.go > /dev/null 2>&1| \
> +  sed -i.bak -e 's/; st_fsid/; st_dev/' gen-sysinfo.go
> +fi

The same remark about egrep | sed -i applies here.

And anyway, why not simply using the very first patch you proposed,
which was:

@@ -536,6 +548,7 @@
 fi | sed -e 's/type _stat64/type Stat_t/' \
          -e 's/type _stat/type Stat_t/' \  
          -e 's/st_dev/Dev/' \
+         -e 's/st_fsid/Dev/' \
          -e 's/st_ino/Ino/g' \
          -e 's/st_nlink/Nlink/' \
          -e 's/st_mode/Mode/' \

which I said several times that it should be completely fine.

Samuel



reply via email to

[Prev in Thread] Current Thread [Next in Thread]