Граф коммитов

11 Коммитов

Автор SHA1 Сообщение Дата
Ian Lance Taylor eb2c74142f unix: add flags parameter to Unlinkat
The flags parameter was added in https://golang.org/cl/7917.  In that CL
the reviewers discussed adding UnlinkAt and changing Unlinkat, and opted
for the latter.

Unfortunately, I then undid that in https://golang.org/cl/10032, which
was a backport of (among others) https://golang.org/cl/5837.  I didn't
notice that in the syscall package 5837 removed Unlinkat with two
parameters, but the port to the x/sys/unix package removed Unlinkat with
three parameters.  Argh.

This CL effectively restores 7917, by adding the parameter back.

Fixes golang/go#9923.

Change-Id: I8fe218ac637d0eb0346b63b596666671374bd19f
Reviewed-on: https://go-review.googlesource.com/18981
Reviewed-by: Rob Pike <r@golang.org>
2016-01-27 15:07:42 +00:00
Kim Shrier 584c5fee74 x/sys/unix: add type specific ioctl functions for termios on solaris
The existing code has no way to manipulate termios or winsize structures
on solaris.  This change adds IoctlGetXXX and IoctlSetXXX functions for
int, termios, termio, and winsize.  The embedded awk script in
mkerrors.sh has additional patterns to generate the needed ioctl
constants for these calls.

Fixes golang/go#12574

Change-Id: Ic62a8c698d42c8ca379c90f71e9f27635e7d03b5
Reviewed-on: https://go-review.googlesource.com/14587
Reviewed-by: Ian Lance Taylor <iant@golang.org>
Reviewed-by: Aram Hăvărneanu <aram@mgk.ro>
2015-09-24 17:12:55 +00:00
Shawn Walker-Salas 68a71b6be5 unix: add various missing syscalls available on Linux
Various syscalls offered by x/sys/unix on Linux are not available on
Solaris and should be, such as Mkfifo, Getwd(), Futimes() and others.
In particular, all of the *at() variants of existing functions were
added where appropriate.

Getgroups() was fixed to use the correct value for its sanity check on
the maximum number of groups.

Utimesnano() was updated to use the native Solaris utimensat function
for setting nanosecond-precision time.

Utimes() was updated to have the same error semantics and checking as
other platforms.

Getgroups(), anysocktoaddr(), and Recvmsg() were fixed to check the
return value before assuming syscall failure instead of relying solely
on errno being set.

mksyscall_solaris.pl needed some updates to better match the output of
the one found in syscall.

mkerrors.sh needed some updates to work out of the box on Solaris,
matching those recently done to the one in syscall.

The signatures (names) of some function parameters were changed to be
consistent with other platforms for the sake of documentation.

Fixes #8609

Change-Id: I9e4e2fee6d3ecfad9f4d845a5702ffde5166e804
Reviewed-on: https://go-review.googlesource.com/14643
Reviewed-by: Aram Hăvărneanu <aram@mgk.ro>
2015-09-17 18:12:33 +00:00
Shawn Walker-Salas 131454b560 unix: fix Getpagesize to return actual system value on Solaris
In preparation for issues such as #10180, Getpagesize() needs to be
fixed to return the actual system's page size instead of assuming it's
always 4096.

This is particularly important for future platform support on Solaris.

Fixes #12076

Change-Id: I78205165909529215fe93ed6ba56e9c3ee1c2abb
Reviewed-on: https://go-review.googlesource.com/14483
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
2015-09-10 21:42:51 +00:00
Ken Sedgwick 09d970dc3f unix: added solaris mmap, munmap and madvise.
These are needed by boltdb.

Change-Id: Ie6afa51dbf6436bb014f53f6b56ee2de6a06827d
Reviewed-on: https://go-review.googlesource.com/13720
Reviewed-by: Aram Hăvărneanu <aram@mgk.ro>
2015-08-20 11:07:44 +00:00
Shawn Walker-Salas 339fc2ca4b unix: update to use direct linking on Solaris
CL 9184 changed the runtime and syscall packages to link Solaris binaries
directly instead of using dlopen/dlsym but failed to update sys/unix to
reflect these changes.  This changes the Solaris port to use direct linking
as supported by Go 1.5.

Fixes golang/go#10086

Change-Id: I6747ed939775b18fd967f81853c7d84537aa3842
Reviewed-on: https://go-review.googlesource.com/13400
Reviewed-by: Austin Clements <austin@google.com>
Reviewed-by: Aram Hăvărneanu <aram@mgk.ro>
2015-08-19 10:26:52 +00:00
Shenghou Ma 379497e3ff unix: add explicit build tags
Change-Id: I62774b8ee0c1a7cc1a3b7009ca860e3fd64a6564
Signed-off-by: Shenghou Ma <minux@golang.org>
Reviewed-on: https://go-review.googlesource.com/10182
Reviewed-by: Rob Pike <r@golang.org>
2015-05-18 19:15:57 +00:00
Rob Pike c1f6f8bcc5 go.sys/unix: use "use" in syscall interface
LGTM=iant
R=golang-codereviews, iant
CC=golang-codereviews
https://golang.org/cl/144980043
2014-09-16 13:36:53 -07:00
Rob Pike dc3c21c62b go.sys/unix: use syscall.Errno for errors
If we use a local type, it won't compare properly with errors from
the rest of the standard library. Errors are the one type from syscall
that propagates through the system, so it's important to have only
one type for them.

Ditto for syscall.Signal.

LGTM=dave
R=rsc, dave
CC=golang-codereviews
https://golang.org/cl/123490043
2014-08-15 09:57:24 -07:00
Rob Pike 8442dd2c63 go.sys: update package names
Semi-automatic migration from package syscall to package {plan9,windows,unix}.
No builds attempted yet, but this gets a lot of noise behind us so subsequent
CLs will be more concise and easier to follow.
Subsequent CLs will have semantic content.

LGTM=rsc
R=golang-codereviews, rsc
CC=golang-codereviews
https://golang.org/cl/121520043
2014-08-11 15:58:26 -07:00
Rob Pike 20acc5cf31 go.sys: copy files from syscall package to go.sys/{plan9,windows,unix}
This CL copies to each package of go.sys the files from syscall it will need.
Different directories have different files, but these:
        mkall.sh
        str.go
        syscall.go
        mksyscall.pl
        race.go
        race0.go
        syscall_test.go
are copied to all three.
No changes yet, these are just copies. They are not ready to use yet:
package names are wrong, for starters. But this clean copy will make
it easier to follow the changes as the packages are enabled.

LGTM=rsc
R=golang-codereviews, rsc
CC=golang-codereviews
https://golang.org/cl/126960043
2014-08-11 14:48:46 -07:00