summaryrefslogtreecommitdiff
path: root/src/syscall
Commit message (Collapse)AuthorAgeFilesLines
* all: power64 is now ppc64Russ Cox2014-12-0512-11/+11
| | | | | | | | | Fixes issue 8654. LGTM=austin R=austin CC=golang-codereviews https://codereview.appspot.com/180600043
* [dev.cc] all: merge default (e4ab8f908aac) into dev.ccRuss Cox2014-11-2014-102/+9782
|\ | | | | | | | | | | TBR=austin CC=golang-codereviews https://codereview.appspot.com/179040044
| * [dev.power64] all: merge default (dd5014ed9b01) into dev.power64Russ Cox2014-10-2914-102/+9782
| |\ | | | | | | | | | | | | | | | | | | | | | | | | Still passes on amd64. LGTM=austin R=austin CC=golang-codereviews https://codereview.appspot.com/165110043
| | * [dev.power64] runtime: power64 fixes and ports of changesAustin Clements2014-10-272-1/+8
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Fix include paths that got moved in the great pkg/ rename. Add missing runtime/arch_* files for power64. Port changes that happened on default since branching to runtime/{asm,atomic,sys_linux}_power64x.s (precise stacks, calling convention change, various new and deleted functions. Port struct renaming and fix some bugs in runtime/defs_linux_power64.h. LGTM=rsc R=rsc, dave CC=golang-codereviews https://codereview.appspot.com/161450043
| | * [dev.power64] all: merge default into dev.power64Austin Clements2014-10-2213-102/+9775
| | |\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This brings dev.power64 up-to-date with the current tip of default. go_bootstrap is still panicking with a bad defer when initializing the runtime (even on amd64). LGTM=rsc R=rsc CC=golang-codereviews https://codereview.appspot.com/152570049
| | | * build: merge the great pkg/ rename into dev.power64Austin Clements2014-10-22220-0/+98196
| | | |\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This also removes pkg/runtime/traceback_lr.c, which was ported to Go in an earlier commit and then moved to runtime/traceback.go. Reviewer: rsc@golang.org rsc: LGTM
* | | | | undo CL 131750044 / 2d6d44ceb80eRuss Cox2014-11-192-73/+3
|/ / / / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Breaks reading from stdin in parent after exec with SysProcAttr{Setpgid: true}. package main import ( "fmt" "os" "os/exec" "syscall" ) func main() { cmd := exec.Command("true") cmd.SysProcAttr = &syscall.SysProcAttr{Setpgid: true} cmd.Run() fmt.Printf("Hit enter:") os.Stdin.Read(make([]byte, 100)) fmt.Printf("Bye\n") } In go1.3, I type enter at the prompt and the program exits. With the CL being rolled back, the program wedges at the prompt. ??? original CL description syscall: SysProcAttr job control changes Making the child's process group the foreground process group and placing the child in a specific process group involves co-ordination between the parent and child that must be done post-fork but pre-exec. LGTM=iant R=golang-codereviews, gobot, iant, mikioh.mikioh CC=golang-codereviews https://codereview.appspot.com/131750044 Committer: Ian Lance Taylor <iant@golang.org> ??? LGTM=minux, dneil R=dneil, minux CC=golang-codereviews, iant, michael.p.macinnis https://codereview.appspot.com/174450043
* | | | syscall: fix ParseRoutingSockaddr with unexpected submessagesRuss Cox2014-10-281-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | No easy way to test (would have to actually trigger some routing events from kernel) but the code is clearly wrong as written. If the header says there is a submessage, we need to at least skip over its bytes, not just continue to the next iteration. Fixes issue 8203. LGTM=r R=r CC=golang-codereviews, mikioh.mikioh, p https://codereview.appspot.com/164140044
* | | | syscall: accept pre-existing directories in nacl zip fileRuss Cox2014-10-271-0/+6
|/ / / | | | | | | | | | | | | | | | | | | | | | | | | NaCl creates /tmp. This lets the zip file populate it. LGTM=adg R=adg CC=golang-codereviews https://codereview.appspot.com/159600043
* | | syscall: don't cache environment variables on Plan 9David du Colombier2014-10-161-82/+15
| | | | | | | | | | | | | | | | | | | | | | | | | | | Fixes issue 8849. LGTM=bradfitz, aram R=bradfitz, rsc, aram CC=golang-codereviews https://codereview.appspot.com/158970045
* | | net: disable SIO_UDP_CONNRESET behavior on windows.Ron Hashimoto2014-10-101-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Fixes issue 5834. LGTM=alex.brainman R=golang-codereviews, bradfitz, alex.brainman, mikioh.mikioh, in60jp, iant CC=golang-codereviews https://codereview.appspot.com/149510043 Committer: Alex Brainman <alex.brainman@gmail.com>
* | | os, syscall: test Chtimes on directories, fix on WindowsRuss Cox2014-10-061-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | Fixes issue 8090. LGTM=alex.brainman R=alex.brainman CC=golang-codereviews https://codereview.appspot.com/154020043
* | | syscall: another attempt to keep windows syscall pointers liveAlex Brainman2014-10-052-15/+100
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This approach was suggested in https://codereview.appspot.com/138250043/#msg15. Unlike current version of mksyscall_windows.go, new code could be used in go.sys and other external repos without help from asm. LGTM=iant R=golang-codereviews, iant, r CC=golang-codereviews https://codereview.appspot.com/143160046
* | | undo CL 138250043 / 4eda5e4001fdAlex Brainman2014-10-032-33/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | I will use different approach to solve this problem. See CL 143160046 for details. ??? original CL description syscall: keep Windows syscall pointers live too Like https://codereview.appspot.com/139360044 LGTM=rsc, alex.brainman R=alex.brainman, rsc CC=golang-codereviews https://codereview.appspot.com/138250043 ??? LGTM=r R=golang-codereviews, bradfitz, r CC=golang-codereviews https://codereview.appspot.com/147440043
* | | syscall: support UID/GID map files for Linux user namespacesMrunal Patel2014-10-021-12/+111
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Fixes issue 8447. LGTM=iant R=golang-codereviews, bradfitz, iant CC=golang-codereviews https://codereview.appspot.com/126190043 Committer: Ian Lance Taylor <iant@golang.org>
* | | syscall: fix Setenv for plan 9Nicolas Owens2014-10-021-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | envi needs to be updated during Setenv so the key can be correctly deleted later with Unsetenv. Update issue 8849. LGTM=0intro R=bradfitz, 0intro CC=golang-codereviews https://codereview.appspot.com/149300046 Committer: David du Colombier <0intro@gmail.com>
* | | os, syscall: add UnsetenvBrad Fitzpatrick2014-10-013-11/+79
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Also address a TODO, making Clearenv pass through to cgo. Based largely on Minux's earlier https://codereview.appspot.com/82040044 Fixes Issue 6423 LGTM=iant, alex.brainman, r, rsc R=rsc, iant, r, alex.brainman CC=golang-codereviews https://codereview.appspot.com/148370043
* | | cmd/cc, cmd/ld, runtime: disallow conservative data/bss objectsRuss Cox2014-09-241-1/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | In linker, refuse to write conservative (array of pointers) as the garbage collection type for any variable in the data/bss GC program. In the linker, attach the Go type to an already-read C declaration during dedup. This gives us Go types for C globals for free as long as the cmd/dist-generated Go code contains the declaration. (Most runtime C declarations have a corresponding Go declaration. Both are bss declarations and so the linker dedups them.) In cmd/dist, add a few more C files to the auto-Go-declaration list in order to get Go type information for the C declarations into the linker. In C compiler, mark all non-pointer-containing global declarations and all string data as NOPTR. This allows them to exist in C files without any corresponding Go declaration. Count C function pointers as "non-pointer-containing", since we have no heap-allocated C functions. In runtime, add NOPTR to the remaining pointer-containing declarations, none of which refer to Go heap objects. In runtime, also move os.Args and syscall.envs data into runtime-owned variables. Otherwise, in programs that do not import os or syscall, the runtime variables named os.Args and syscall.envs will be missing type information. I believe that this CL eliminates the final source of conservative GC scanning in non-SWIG Go programs, and therefore... Fixes issue 909. LGTM=iant R=iant CC=golang-codereviews https://codereview.appspot.com/149770043
* | | syscall: mark ECONNRESET, ECONNABORTED as temporary network errorsRuss Cox2014-09-181-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | Fixes issue 6163. LGTM=adg R=golang-codereviews, adg, dvyukov CC=golang-codereviews https://codereview.appspot.com/141600043
* | | syscall: fix infinite recursion in itoaRuss Cox2014-09-183-1/+29
| | | | | | | | | | | | | | | | | | | | | | | | | | | Fixes issue 8332. LGTM=dvyukov R=golang-codereviews, dvyukov CC=golang-codereviews https://codereview.appspot.com/138650044
* | | liblink: make GO_ARGS the default for functions beginning with ?Russ Cox2014-09-1620-91/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | If there is a leading ?, assume there is a Go prototype and attach the Go prototype information to the function. If the function is not called from Go and does not need a Go prototype, it can be made file-local instead (using name<>(SB)). This fixes the current BSD build failures, by giving functions like sync/atomic.StoreUint32 argument stack map information. Fixes issue 8753. LGTM=khr, iant R=golang-codereviews, iant, khr, bradfitz CC=golang-codereviews, r, rlh https://codereview.appspot.com/142150043
* | | syscall: add GO_ARGS to Go-called assemblyRuss Cox2014-09-145-0/+11
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Fixes sporadic linux/386 build failure (untyped args) and probably some others we haven't observed yet. Fixes issue 8727. TBR=iant R=golang-codereviews CC=bradfitz, golang-codereviews, iant, khr, r https://codereview.appspot.com/143930043
* | | runtime: convert syscall_windows.c to GoRuss Cox2014-09-142-14/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This is necessary because syscall.Syscall blocks, and the garbage collector needs to be able to scan that frame while it is blocked, and C frames have no garbage collection information. Windows builders are broken now due to this problem: http://build.golang.org/log/152ca9a4be6783d3a8bf6e2f5b9fc265089728b6 LGTM=alex.brainman R=alex.brainman CC=golang-codereviews https://codereview.appspot.com/144830043
* | | syscall: add #include "funcdata.h" to files modified in last CLRuss Cox2014-09-1219-0/+19
| | | | | | | | | | | | | | | | | | | | | | | | That's what defines GO_ARGS. TBR=khr CC=golang-codereviews https://codereview.appspot.com/141460043
* | | syscall: make func Syscall use pointer maps from Go prototypesRuss Cox2014-09-1220-0/+83
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Before, Syscall and friends were having their arguments treated conservatively. Now they will use the Go prototype, which will mean the arguments are not considered pointers at all. This is safe because of CL 139360044. The fact that all these non-Solaris systems were using conservative scanning of the Syscall arguments is why the failure that prompted CL 139360044 was only observed on Solaris, which does something completely different. If we'd done this earlier, we'd have seen the Solaris failure in more places. LGTM=khr R=khr CC=golang-codereviews https://codereview.appspot.com/144730043
* | | syscall: SysProcAttr job control changesMichael MacInnis2014-09-112-4/+76
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Making the child's process group the foreground process group and placing the child in a specific process group involves co-ordination between the parent and child that must be done post-fork but pre-exec. LGTM=iant R=golang-codereviews, gobot, iant, mikioh.mikioh CC=golang-codereviews https://codereview.appspot.com/131750044 Committer: Ian Lance Taylor <iant@golang.org>
* | | syscall: keep Windows syscall pointers live tooBrad Fitzpatrick2014-09-082-6/+33
| | | | | | | | | | | | | | | | | | | | | | | | | | | Like https://codereview.appspot.com/139360044 LGTM=rsc, alex.brainman R=alex.brainman, rsc CC=golang-codereviews https://codereview.appspot.com/138250043
* | | syscall: fix comment in mkall_windows.batBrad Fitzpatrick2014-09-081-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | src/pkg -> src LGTM=alex.brainman R=alex.brainman CC=golang-codereviews https://codereview.appspot.com/139400043
* | | syscall: keep allocated C string live across call to SyscallRuss Cox2014-09-0829-23/+607
| |/ |/| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Given: p := alloc() fn_taking_ptr(p) p is NOT recorded as live at the call to fn_taking_ptr: it's not needed by the code following the call. p was passed to fn_taking_ptr, and fn_taking_ptr must keep it alive as long as it needs it. In practice, fn_taking_ptr will keep its own arguments live for as long as the function is executing. But if instead you have: p := alloc() i := uintptr(unsafe.Pointer(p)) fn_taking_int(i) p is STILL NOT recorded as live at the call to fn_taking_int: it's not needed by the code following the call. fn_taking_int is responsible for keeping its own arguments live, but fn_taking_int is written to take an integer, so even though fn_taking_int does keep its argument live, that argument does not keep the allocated memory live, because the garbage collector does not dereference integers. The shorter form: p := alloc() fn_taking_int(uintptr(unsafe.Pointer(p))) and the even shorter form: fn_taking_int(uintptr(unsafe.Pointer(alloc()))) are both the same as the 3-line form above. syscall.Syscall is like fn_taking_int: it is written to take a list of integers, and yet those integers are sometimes pointers. If there is no other copy of those pointers being kept live, the memory they point at may be garbage collected during the call to syscall.Syscall. This is happening on Solaris: for whatever reason, the timing is such that the garbage collector manages to free the string argument to the open(2) system call before the system call has been invoked. Change the system call wrappers to insert explicit references that will keep the allocations alive in the original frame (and therefore preserve the memory) until after syscall.Syscall has returned. Should fix Solaris flakiness. This is not a problem for cgo, because cgo wrappers have correctly typed arguments. LGTM=iant, khr, aram, rlh R=iant, khr, bradfitz, aram, rlh CC=dvyukov, golang-codereviews, r https://codereview.appspot.com/139360044
* | build: move package sources from src/pkg to srcRuss Cox2014-09-08210-0/+88523
|/ | | | | | Preparation was in CL 134570043. This CL contains only the effect of 'hg mv src/pkg/* src'. For more about the move, see golang.org/s/go14nopkg.
* move src/syscall to src/lib/syscall.Russ Cox2008-09-2610-1084/+0
| | | | | | | | | | | enforce rule: all kernel data structures and constants go in syscall module. move things that should be in syscall out of net. make net a single package. R=r OCL=15985 CL=15994
* time bug: darwin, linux return microseconds not nanosecondsRuss Cox2008-09-222-2/+2
| | | | | | | R=r DELTA=2 (0 added, 0 deleted, 2 changed) OCL=15626 CL=15641
* make Makefiles safe for parallel makeRuss Cox2008-09-181-0/+3
| | | | | | | | | | | | | use -j4 (4-way parallel) in make.bash. halves time for make.bash on r45 also add libregexp, acid to default build R=r DELTA=90 (39 added, 37 deleted, 14 changed) OCL=15485 CL=15487
* time & date.Russ Cox2008-09-178-26/+70
| | | | | | | | rename AddrToInt, StatToInt, etc -> BytePtr, StatPtr, ... R=r OCL=15450 CL=15456
* add network listening & testsRuss Cox2008-09-171-1/+0
| | | | | | R=r,presotto OCL=15410 CL=15440
* preliminary network - just Dial for nowRuss Cox2008-09-163-0/+43
| | | | | | R=r,presotto OCL=15393 CL=15399
* pull O_RDONLY etc. up to os libraryRob Pike2008-09-112-2/+2
| | | | | | | R=rsc DELTA=16 (14 added, 0 deleted, 2 changed) OCL=15156 CL=15163
* make syscall use strings for file namesRob Pike2008-09-114-23/+81
| | | | | | | | | | | | | | | | | | | | | | tweak os to adjust move StringToBytes into syscall, at least for now this program still works: package main import os "os" func main() { os.Stdout.WriteString("hello, world\n"); a, b := os.NewFD(77).WriteString("no way"); os.Stdout.WriteString(b.String() + "\n"); } R=rsc DELTA=263 (59 added, 176 deleted, 28 changed) OCL=15153 CL=15153
* use a makefile to build mathRob Pike2008-09-051-2/+2
| | | | | | | | fix a typo in syscall/Makefile R=ken OCL=14863 CL=14863
* fix bug: was writing off end of arrayRob Pike2008-09-021-1/+0
| | | | | | R=gri OCL=14728 CL=14728
* - switched most of existing Go code to new export syntaxRobert Griesemer2008-08-043-64/+32
| | | | | | | | | - adjusted lang doc R=r DELTA=192 (26 added, 65 deleted, 101 changed) OCL=13844 CL=13848
* first cut at multithreading. works on Linux.Russ Cox2008-08-041-1/+3
| | | | | | | | | | | | | | | | | | * kick off new os procs (machs) as needed * add sys?sleep for testing * add Lock, Rendez * properly lock mal, sys?newproc, scheduler * linux syscall arg #4 is in R10, not CX * chans are not multithread-safe yet * multithreading disabled by default; set $gomaxprocs=2 (or 1000) to turn it on This should build on OS X but may not. Rob and I will fix soon after submitting. TBR=r OCL=13784 CL=13842
* use new export syntax to avoid repetitionRob Pike2008-08-042-247/+4
| | | | | | R=gri OCL=13819 CL=13819
* - mark syscall support routines as non-stack-generatingRob Pike2008-07-304-20/+102
| | | | | | | | | | - add unlink, creat - add constants for open - fix some comments R=gri OCL=13654 CL=13656
* fix a commentRob Pike2008-07-291-4/+1
| | | | | | | | fix a register name R=gri OCL=13548 CL=13548
* fixes for linux system call linkageRob Pike2008-07-292-3/+14
| | | | | | R=gri OCL=13547 CL=13547
* rewrite system call interface to use less assembler.Rob Pike2008-07-299-290/+257
| | | | | | R=gri OCL=13546 CL=13546
* fix type error caused by recent changeRob Pike2008-07-292-4/+4
| | | | | | R=gri OCL=13545 CL=13545
* add lstatRob Pike2008-07-287-19/+46
| | | | | | | | | | clean up some code fix comments add paramter names to interface R=ken OCL=13521 CL=13521
* add fstat, statRob Pike2008-07-266-100/+159
| | | | | | R=ken OCL=13497 CL=13497