Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

syscall: should contain X_OK, R_OK & W_OK for use with syscall.Access() #6262

Closed
ThomasHabets opened this issue Aug 27, 2013 · 5 comments
Closed

Comments

@ThomasHabets
Copy link
Contributor

@ThomasHabets ThomasHabets commented Aug 27, 2013

What steps will reproduce the problem?
1. write code like syscall.Access("foo", syscall.X_OK)
2. try to run "go run a.go"
3. Get error:
./a.go:8: undefined: syscall.X_OK

What is the expected output?
Expect [RXW]_OK to exist. Otherwise how can syscall.Access() be used?

What do you see instead?
Compile error.

Which compiler are you using (5g, 6g, 8g, gccgo)?
whichever is the amd64 one.

Which operating system are you using?
Linux

Which version are you using?  (run 'go version')
go version go1.1 linux/amd64

Please provide any additional information below.

Filing bug as requested.
@ianlancetaylor
Copy link
Contributor

@ianlancetaylor ianlancetaylor commented Aug 27, 2013

Comment 1:

Labels changed: added priority-later, go1.2maybe, removed priority-triage.

Status changed to Accepted.

@ThomasHabets
Copy link
Contributor Author

@ThomasHabets ThomasHabets commented Aug 28, 2013

Comment 2:

Also F_OK.
@rsc
Copy link
Contributor

@rsc rsc commented Sep 9, 2013

Comment 3:

syscall.Access can be used because these constants are the same as the file permission
bits. R_OK=4, W_OK=2, X_OK=1, F_OK=0, on all systems. People just wrote the numbers
before POSIX came along and decided to name everything.
Not critical, so leaving for Go 1.3.

Labels changed: added go1.3maybe, removed go1.2maybe.

@rsc
Copy link
Contributor

@rsc rsc commented Dec 4, 2013

Comment 4:

Labels changed: added release-none, removed go1.3maybe.

@rsc
Copy link
Contributor

@rsc rsc commented Dec 4, 2013

Comment 5:

Labels changed: added repo-main.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
4 participants
You can’t perform that action at this time.