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: Svante Signell
Subject: Re: patch8.diff updated Was: Re: GCC's -fsplit-stack disturbing Mach's vm_allocate
Date: Wed, 21 May 2014 09:47:08 +0200

On Wed, 2014-05-21 at 01:27 +0200, Samuel Thibault wrote:
> 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.

I don't know, I'm not a go developer. Ask Ian.

> > +# 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.

Well, the -i option is to get a backup copy for debugging purposes, can
safely be removed. BTW: On Linux no .bak files are generated, as
expected. Regarding the code I attach mksysinfo.sh and config.h.hurd  to
be run on Hurd and config.h.linux to be run on Linux. Good luck making
the patch better. It worked for me, but as I wrote before I'm no
sed/grep expert.

Attachment: config.h.hurd
Description: Text Data

Attachment: mksysinfo.sh
Description: application/shellscript

Attachment: config.h.linux
Description: Text Data


reply via email to

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