-
Notifications
You must be signed in to change notification settings - Fork 17.9k
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
x/sys/unix: add Fstatat on Linux on more than just GOARCH=arm64 #14216
Comments
Go for it. |
Actually, looks like I'm not going to end up getting to this (at least not soon) -- I've been pulled away onto another project. So I'm going to leave this note here and if someone else gets to it before I come back, that's OK with me. P.S. fdopendir is the *at family version of opendir, but since it's not a syscall, I'm not sure where it should live. |
I need the fstatat syscall for a project, at least on Linux. In future I would like to add support for other systems like FreeBSD and Darwin. |
Before I got pulled back to my main job hacking on Git, I had written the attached patch. At the time, I didn't have permission from Twitter legal to post it, but they have since given me permission. I don't recall what state this was in -- that is, what parts of it worked, what testing was done, etc. Sorry for the poor record-keeping here. Anyway, it's a starting point. If you need any assignments or signatures in order to use this, I am happy to execute them. |
@dturner-tw thanks for the patch. However I already patched my local clone of x/sys in order to add support for fstatat for linux amd64. This will allow me to test my project and waiting for official support before releasing it. Just some little differences from your code. Instead of generating the //sys Fstatat(fd int, path string, stat *Stat_t, flags int) (err error) = SYS_NEWFSTATAT Another difference is that I declared Fstatat in syscall_linux_amd64.go, instead of syscall_linux.go, but this a topic that I'm not sure to understand well. |
Support for linkat, readlinkat and symlinkat was added in golang/sys@9bb9f09 (#14459) |
Let's make this bug only about fstatat. Here's the current status as of 50298aa:
It exists for arm64, but not the rest. Looks like the syscall has evolved a bit over the years, so this might require manually written wrappers to make the API feel the same everywhere (matching linux/arm64) |
CL https://golang.org/cl/48530 mentions this issue. |
Add the Mkfifoat function on Linux, akin to the existing Mkfifo function but taking an additional dirfd parameter. See http://man7.org/linux/man-pages/man3/mkfifo.3.html Originally requested in golang/go#14216 Also remove the named result parameter for Mkfifo, as they add no additional use (suggested by Brad Fitzpatrick). Change-Id: I7b759752abf3e1469d7f883a7f13313e3062aeb4 Reviewed-on: https://go-review.googlesource.com/48530 Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
Add the Mkfifoat function on Linux, akin to the existing Mkfifo function but taking an additional dirfd parameter. See http://man7.org/linux/man-pages/man3/mkfifo.3.html Originally requested in golang/go#14216 Also remove the named result parameter for Mkfifo, as they add no additional use (suggested by Brad Fitzpatrick). Change-Id: I7b759752abf3e1469d7f883a7f13313e3062aeb4 Reviewed-on: https://go-review.googlesource.com/48530 Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
Change https://golang.org/cl/79795 mentions this issue: |
x/sys/unix doesn't have the following posix functions:
fstatat()
linkat()
mkfifoat()
readlinkat()
symlinkat()
utimensat()
I propose to add exactly fstat, symlinkat, and linkat because I think those are the only ones I am likely to use.
The text was updated successfully, but these errors were encountered: