1
0
mirror of https://github.com/golang/go synced 2024-10-04 10:21:21 -06:00
Commit Graph

431 Commits

Author SHA1 Message Date
Benny Siegert
677cdb800d syscall: use pipe instead of pipe2 on NetBSD
pipe2 is equivalent to pipe with flags set to 0.
However, pipe2 was only added recently. Using pipe
instead improves compatibility with NetBSD 5.

R=jsing
CC=golang-dev
https://golang.org/cl/6268045
2012-06-05 01:29:34 +10:00
Alex Brainman
8801402940 syscall: correct Win32finddata definition
Fixes #3685.

R=golang-dev, rsc
CC=golang-dev
https://golang.org/cl/6261053
2012-06-03 19:27:17 +10:00
Shenghou Ma
911f802b37 syscall: fix 32-bit uid calls
16-bit uid calls are not always supported in newer kernels.

R=dave, rsc, bradfitz
CC=golang-dev
https://golang.org/cl/6279047
2012-06-03 06:49:57 +08:00
Alex Brainman
042848da65 syscall: simplify text returned by Errno.Error() when FormatMessage fails
Fixes #3623.

R=golang-dev, bsiegert, rsc
CC=golang-dev
https://golang.org/cl/6218072
2012-05-27 18:57:16 +10:00
Alex Brainman
50e5951374 syscall: implement SetsockoptLinger for windows
R=rsc
CC=golang-dev
https://golang.org/cl/6225048
2012-05-23 13:05:05 +10:00
Joel Sing
495a9dc2b3 syscall: implement nametomib() on netbsd
Implement nametomib() on NetBSD using the CTL_QUERY node discovery
mechanism.

R=golang-dev, rsc
CC=golang-dev
https://golang.org/cl/6211071
2012-05-23 01:33:48 +10:00
Joel Sing
67a0c4f7f9 syscall: fix SockaddrDatalink on netbsd
RawSockaddrDatalink and SockaddrDatalink need to match - make Data
have length 12 for both.

R=golang-dev, mikioh.mikioh
CC=golang-dev
https://golang.org/cl/6223051
2012-05-21 00:13:22 +10:00
Mikio Hara
9cfb845af6 syscall: add comment
R=golang-dev, bradfitz
CC=golang-dev
https://golang.org/cl/6215046
2012-05-19 08:35:51 +09:00
Joel Sing
b554fb912f os/syscall: correct netbsd types/names
Fix types/names so that these functions work with the generated
syscall/z* files.

R=golang-dev, m4dh4tt3r
CC=golang-dev
https://golang.org/cl/6201078
2012-05-15 12:00:13 +10:00
Joel Sing
2a47e0444c syscall: regenerate z* files for netbsd
Fix mkerrors.sh so that it works on NetBSD.

Remove directory mode bits from types - this already appears in errors.

Regenerate the z* files now that cgo is working.

R=golang-dev, m4dh4tt3r, r
CC=golang-dev
https://golang.org/cl/6201077
2012-05-14 10:40:13 -07:00
Joel Sing
a1bf5207af syscall: repair netbsd z* files
Manually repair/update z* files for netbsd - this allows Go to
compile again on 386.

R=golang-dev, rsc, minux.ma
CC=golang-dev
https://golang.org/cl/6194064
2012-05-11 03:47:27 +10:00
Anthony Martin
fe5005f721 syscall: remove the Signal type on Plan 9
Instead use a new type, "Note", whose underlying
type is just a string.  This change allows us to
remove the exported os.Plan9Note type.

R=bradfitz, seed, rsc
CC=golang-dev
https://golang.org/cl/6015046
2012-05-04 03:44:41 -07:00
Francisco Souza
61060acdc1 syscall: add Termios support on darwin
Update #3316.

R=dave, kevlar, devon.odell, rsc, minux.ma
CC=golang-dev
https://golang.org/cl/6063053
2012-05-03 17:33:19 -04:00
Alex Brainman
0d55d9832f os/signal: run windows TestCtrlBreak during build
R=golang-dev, rsc
CC=golang-dev
https://golang.org/cl/6136054
2012-05-02 17:05:52 +10:00
Brad Fitzpatrick
fe2ce5285e syscall: add a test for passing an fd over a unix socket
Re-submitting previously reverted change 160ec5506cb7.

R=golang-dev, r, r
CC=golang-dev
https://golang.org/cl/6129052
2012-04-30 15:31:14 +10:00
Joel Sing
e5f2662c25 syscall: remove sysctl workaround for openbsd
Now that Go will no longer work on OpenBSD versions prior to 5.1,
remove the sysctl workaround that was needed for 5.0 and earlier.

R=golang-dev, bradfitz
CC=golang-dev
https://golang.org/cl/6116050
2012-04-27 01:45:15 +10:00
Anthony Martin
5491623406 syscall: fix a number of exec bugs on Plan 9
1. Readdirnames was erroneously returning an
   empty slice on every invocation.

2. The logic for determining which files to
   close before exec was incorrect.  If the
   set of files to be kept open (provided by
   the caller) did not include the files
   opened at startup, those files would be
   accidentally closed.

I also cleaned up readdupdevice while I was
in the vicinity.

R=golang-dev, seed, rsc
CC=golang-dev
https://golang.org/cl/6016044
2012-04-26 02:59:13 -07:00
Akshat Kumar
49a7da2dd9 syscall: cleanly exit all Go procs on Plan 9
syscall.Exit would originally kill only the calling
Go proc, leaving behind other procs in the
same group. This change makes syscall.Exit call
runtime·exit, which due to CL
https://golang.org/cl/5617048
will cleanly exit all the Go procs in the group.

R=golang-dev, rsc, rminnich, remyoudompheng, ality, john
CC=golang-dev, mirtchovski
https://golang.org/cl/6036051
2012-04-19 16:31:26 -07:00
Akshat Kumar
4cf577edf9 syscall: fix duplicate fd bug for Plan 9
This change comes from CL 5536043,
created by Andrey Mirtchovski. His
description follows:

"The plan9 exec child handler does not manage
dup-ed fds from the parent correctly: when a
dup-ed file descriptor appears in the child's fd
list it is closed when first encountered and then
subsequent attempt to dup it later in Pass 2 fails,
resulting in 'fork/exec: fd out of range or not
open'."

R=golang-dev, rminnich, ality
CC=golang-dev, mirtchovski, rsc
https://golang.org/cl/6009046
2012-04-16 17:35:15 -07:00
Shenghou Ma
ae382129f1 syscall: support Getpid() on Windows
Fixes #3379.

R=golang-dev, alex.brainman, rsc, bradfitz
CC=golang-dev
https://golang.org/cl/5909043
2012-04-10 22:34:31 +08:00
Benny Siegert
559c191b89 syscall: manually fix z* for NetBSD/amd64
Building go currently fails on NetBSD, thus the regeneration
scripts do not run correctly. With these changes, at least
the go_bootstrap tool builds correctly.

R=golang-dev, r, bradfitz
CC=golang-dev
https://golang.org/cl/5695064
2012-04-06 07:57:05 -07:00
Ian Lance Taylor
35bc9d17df syscall, net: use native endianness for Linux netlink messages
Tested using 6g and gccgo on x86_64 GNU/Linux and using gccgo
on PowerPC GNU/Linux (which is big-endian).

R=golang-dev, bradfitz, mikioh.mikioh, iant
CC=golang-dev
https://golang.org/cl/5975073
2012-04-04 17:41:36 -07:00
Alex Brainman
7a39654174 path/filepath: use windows GetShortPathName api to force GetLongPathName to do its work
R=golang-dev, rsc
CC=golang-dev
https://golang.org/cl/5928043
2012-03-27 15:53:08 +11:00
Rob Pike
1f6fc949f6 sysycall: remove creds_linux_test.go
It is unprecedented to add tests to package syscall, especially
system-specific ones. Not a policy worth changing right before Go 1
is cut.

The sole existing test, passfd_test.go, contains the line
        // +build linux darwin probablyfreebsd probablyopenbsd
which argues that this is not a subject to be undertaking likely.
Note that passfd_test.go also went in just now. It's the only test
in syscall.

Deleting for now, will reconsider after Go 1.

R=golang-dev, bradfitz, r, dsymonds
CC=golang-dev
https://golang.org/cl/5846063
2012-03-19 11:15:28 +11:00
Rob Pike
4161dfc4fe syscall: delete passfd_test.go
We can revisit the issue of testing in syscall after Go 1.

R=golang-dev, dsymonds
CC=golang-dev
https://golang.org/cl/5844057
2012-03-19 11:12:32 +11:00
Albert Strasheim
6a0544091e syscall: Test SCM_CREDENTIALS, SO_PASSCRED on Linux.
R=bradfitz, iant
CC=golang-dev
https://golang.org/cl/5846059
2012-03-18 10:03:00 -07:00
Brad Fitzpatrick
c97cf055d9 syscall: add a test for passing an fd over a unix socket
Updates #1101

R=golang-dev, iant
CC=golang-dev
https://golang.org/cl/5849057
2012-03-17 22:19:57 -07:00
Robert Griesemer
d724631a53 all: various typos
R=golang-dev, dsymonds
CC=golang-dev
https://golang.org/cl/5820045
2012-03-13 17:29:07 -07:00
Shenghou Ma
0238cec021 os, syscall: windows really isn't posix compliant, fix os.IsExist()
R=golang-dev, rsc, bradfitz, alex.brainman
CC=golang-dev
https://golang.org/cl/5754083
2012-03-13 12:50:04 +11:00
Mikkel Krautz
3133b14b30 crypto/x509: allow server gated crypto in windows systemVerify
Also factors out some code into functions to make
systemVerify easier to read.

R=rsc, agl
CC=golang-dev
https://golang.org/cl/5781054
2012-03-08 11:28:04 -05:00
Alex Brainman
0029b0d207 path/filepath: retrieve real file name in windows EvalSymlinks
R=golang-dev, rsc
CC=golang-dev
https://golang.org/cl/5756049
2012-03-08 10:00:25 +11:00
Mikkel Krautz
a324a5ac20 crypto/x509: new home for root fetchers; build chains using Windows API
This moves the various CA root fetchers from crypto/tls into crypto/x509.

The move was brought about by issue 2997. Windows doesn't ship with all
its root certificates, but will instead download them as-needed when using
CryptoAPI for certificate verification.

This CL changes crypto/x509 to verify a certificate using the system root
CAs when VerifyOptions.RootCAs == nil. On Windows, this verification is
now implemented using Windows's CryptoAPI. All other root fetchers are
unchanged, and still use Go's own verification code.

The CL also fixes the hostname matching logic in crypto/tls/tls.go, in
order to be able to test whether hostname mismatches are honored by the
Windows verification code.

The move to crypto/x509 also allows other packages to use the OS-provided
root certificates, instead of hiding them inside the crypto/tls package.

Fixes #2997.

R=agl, golang-dev, alex.brainman, rsc, mikkel
CC=golang-dev
https://golang.org/cl/5700087
2012-03-07 13:12:35 -05:00
Shenghou Ma
6e211225d7 syscall: fix mkall.sh, mksyscall_linux.pl, and regen for Linux/ARM
CL 3075041 says ARM is not little-endian, but my test suggests otherwise.
My test program is:

    package main
    import ("fmt"; "syscall"; "os")
    func main() {
       err := syscall.Fallocate(1, 1/*FALLOC_FL_KEEP_SIZE*/, 0, int64(40960));
       fmt.Fprintln(os.Stderr, err)
    }

Without this CL, ./test > testfile will show: file too large; and strace shows:
    fallocate(1, 01, 0, 175921860444160)    = -1 EFBIG (File too large)
With this CL, ./test > testfile will show: <nil>; and strace shows:
    fallocate(1, 01, 0, 40960)              = 0

Quoting rsc:
"[It turns out that] ARM syscall ABI requires 64-bit arguments to use an
(even, odd) register pair, not an (odd, even) pair. Switching to "big-endian"
worked because it ended up using the high 32-bits (always zero in the tests
we had) as the padding word, because the 64-bit argument was the last one,
and because we fill in zeros for the rest of the system call arguments, up to
six. So it happened to work."

I updated mksyscall_linux.pl to accommodate the register pair ABI requirement,
and removed all hand-tweaked syscall routines in favor of the auto-generated
ones. These including: Ftruncate, Truncate, Pread and Pwrite.

Some recent Linux/ARM distributions do not bundle kernel asm headers,
so instead we always get latest asm/unistd.h from git.kernel.org (just like
what we do for FreeBSD).

R=ken, r, rsc, r, dave, iant
CC=golang-dev
https://golang.org/cl/5726051
2012-03-06 03:12:11 +08:00
Robert Griesemer
de7361bf98 all: more typos
R=golang-dev, bradfitz, r
CC=golang-dev
https://golang.org/cl/5720044
2012-03-02 11:15:45 -08:00
Alex Brainman
c3fbc9a5e8 os: implement UserTime/SystemTime on windows
Fixes #3145.

R=golang-dev, rsc
CC=golang-dev
https://golang.org/cl/5721044
2012-03-02 14:47:40 +11:00
Shenghou Ma
b17a233633 syscall: force Windows to always use US English error messages
Fixes #1834.

R=rsc, alex.brainman
CC=golang-dev
https://golang.org/cl/5673068
2012-02-20 09:51:25 +11:00
Mikio Hara
03d4c7c7d7 net, os, syscall: delete os.EPLAN9
Also fixes plan9 cross-build.

R=rsc, r
CC=golang-dev
https://golang.org/cl/5675073
2012-02-17 10:59:30 +09:00
Russ Cox
014568bee1 syscall: fix bounds check in Error
Fixes #3042.

R=golang-dev, iant
CC=golang-dev
https://golang.org/cl/5675067
2012-02-16 15:23:50 -05:00
David du Colombier
11f4a6c9df os,syscall: fix plan 9 build
NewFile take uintptr
make syscall.ProcAttr.Files be []uintptr

R=rsc
CC=golang-dev
https://golang.org/cl/5656073
2012-02-16 14:04:51 -05:00
Albert Strasheim
571d6fc5e8 syscall: Make Pdeathsig type Signal in SysProcAttr on Linux.
R=rsc, iant, iant
CC=golang-dev
https://golang.org/cl/5656058
2012-02-14 21:31:20 -08:00
Russ Cox
33f7596f8d syscall: linux Tgkill takes a Signal too
R=golang-dev, gri
CC=golang-dev
https://golang.org/cl/5649089
2012-02-14 13:07:14 -05:00
Mikio Hara
7959960148 syscall: regenerate z-files for openbsd
This CL provides regenerated z-files for OpenBSD 5.0 stable.
Also fixes OpenBSD build.

R=golang-dev, rsc
CC=golang-dev
https://golang.org/cl/5656052
2012-02-14 14:44:59 +09:00
Alex Brainman
07a2989d17 runtime, syscall, os/signal: fix windows build
R=golang-dev, bradfitz
CC=golang-dev
https://golang.org/cl/5656048
2012-02-14 13:51:38 +11:00
Mikio Hara
adc1e0bcef syscall: update BSD variants to sync with new os/signal
R=golang-dev, adg
CC=golang-dev
https://golang.org/cl/5661051
2012-02-14 11:20:39 +09:00
Shenghou Ma
31ab16f98e fix build for Linux/ARM.
1, IMO, the fatal error "regfree: not a register" from 5g when
         compiling runtime/debug.go is due to gcc miscompile, it doesn't
         show up when compiled with -O0. But I still haven't thought of
         a way to fix this, should all ARM builds be built with -O0?
        2, fixed mksysnum_linux.pl, so zsysnum_linux_arm.go no longer
        needs to be hand-generated.
        3, regen all in pkg syscall for Linux/ARM on Debian 6.0
This CL is somewhat big, I'd like to split it if necessary.

R=rsc, dave
CC=golang-dev
https://golang.org/cl/5659044
2012-02-13 20:16:57 -05:00
Andrew Gerrand
2d53d227f6 runtime, syscall: fix freebsd-386 build
R=rsc
CC=golang-dev
https://golang.org/cl/5659045
2012-02-14 10:04:59 +11:00
Andrew Gerrand
7c2607a91d runtime, syscall: fix freebsd build
R=golang-dev, bradfitz
CC=golang-dev
https://golang.org/cl/5661047
2012-02-14 09:29:51 +11:00
Russ Cox
35586f718c os/signal: selective signal handling
Restore package os/signal, with new API:
Notify replaces Incoming, allowing clients
to ask for certain signals only.  Also, signals
go to everyone who asks, not just one client.

This could plausibly move into package os now
that there are no magic side effects as a result
of the import.

Update runtime for new API: move common Unix
signal handling code into signal_unix.c.
(It's so easy to do this now that we don't have
to edit Makefiles!)

Tested on darwin,linux 386,amd64.

Fixes #1266.

R=r, dsymonds, bradfitz, iant, borman
CC=golang-dev
https://golang.org/cl/3749041
2012-02-13 13:52:37 -05:00
Russ Cox
65ba8ee07e syscall: make linux Dup2 match other systems
You could argue for changing all the others, but
Linux is outvoted, and the only time it matters
is when newfd==-1, in which case you can call Dup.

R=golang-dev, r
CC=golang-dev
https://golang.org/cl/5650073
2012-02-13 00:11:36 -05:00
Brad Fitzpatrick
fbab6d8512 os,syscall: fix windows build
make syscall.ProcAttr.Files be []uintptr

all.bash passes on Linux.
things seem to compile on GOOS={darwin,windows}

R=golang-dev, mattn.jp, alex.brainman, rsc
CC=golang-dev
https://golang.org/cl/5653055
2012-02-11 08:47:19 +11:00