Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in
Toggle navigation
G
golang
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Commits
Issue Boards
Open sidebar
go
golang
Commits
cbdaa10f
Commit
cbdaa10f
authored
Jul 15, 2008
by
Rob Pike
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
add linkage for writefile on darwin
SVN=127208
parent
c870ac23
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
22 additions
and
9 deletions
+22
-9
amd64_darwin.h
src/runtime/amd64_darwin.h
+2
-0
amd64_linux.h
src/runtime/amd64_linux.h
+2
-0
sys_amd64_linux.s
src/runtime/sys_amd64_linux.s
+17
-8
sys_file.c
src/runtime/sys_file.c
+1
-1
No files found.
src/runtime/amd64_darwin.h
View file @
cbdaa10f
...
...
@@ -41,3 +41,5 @@ struct stat { // really a stat64
uint32
st_gen
;
int64
st_qspare
[
2
];
};
#define O_CREAT 0x0200
src/runtime/amd64_linux.h
View file @
cbdaa10f
...
...
@@ -38,3 +38,5 @@ struct stat {
struct
timespec
st_mtime
;
/* time of last modification */
struct
timespec
st_ctime
;
/* time of last status change */
};
#define O_CREAT 0100
src/runtime/sys_amd64_linux.s
View file @
cbdaa10f
...
...
@@ -12,17 +12,10 @@ TEXT sys·exit(SB),1,$0-8
SYSCALL
RET
TEXT sys·write(SB),1,$0-24
MOVL 8(SP), DI
MOVQ 16(SP), SI
MOVL 24(SP), DX
MOVL $1, AX // syscall entry
SYSCALL
RET
TEXT open(SB),1,$0-16
MOVQ 8(SP), DI
MOVL 16(SP), SI
MOVL 20(SP), DX
MOVL $2, AX // syscall entry
SYSCALL
RET
...
...
@@ -48,6 +41,22 @@ TEXT read(SB),1,$0-24
SYSCALL
RET
TEXT write(SB),1,$0-24
MOVL 8(SP), DI
MOVQ 16(SP), SI
MOVL 24(SP), DX
MOVL $1, AX // syscall entry
SYSCALL
RET
TEXT sys·write(SB),1,$0-24
MOVL 8(SP), DI
MOVQ 16(SP), SI
MOVL 24(SP), DX
MOVL $1, AX // syscall entry
SYSCALL
RET
TEXT sys·rt_sigaction(SB),1,$0-32
MOVL 8(SP), DI
MOVQ 16(SP), SI
...
...
src/runtime/sys_file.c
View file @
cbdaa10f
...
...
@@ -59,7 +59,7 @@ sys·writefile(string filein, string textin, bool okout)
mcpy
(
namebuf
,
filein
->
str
,
filein
->
len
);
namebuf
[
filein
->
len
]
=
'\0'
;
fd
=
open
(
namebuf
,
1
|
0x0200
,
0644
);
// open for write, create if non-existant (sic)
fd
=
open
(
namebuf
,
1
|
O_CREAT
,
0644
);
// open for write, create if non-existant (sic)
if
(
fd
<
0
)
goto
out
;
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment