mirror of
https://github.com/rwinkhart/sys.git
synced 2026-09-05 08:37:31 -04:00
unix: add Mkfifoat function on Linux
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>
This commit is contained in:
committed by
Brad Fitzpatrick
parent
abf9c25f54
commit
4cd6d1a821
@@ -342,10 +342,14 @@ func Wait4(pid int, wstatus *WaitStatus, options int, rusage *Rusage) (wpid int,
|
|||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
func Mkfifo(path string, mode uint32) (err error) {
|
func Mkfifo(path string, mode uint32) error {
|
||||||
return Mknod(path, mode|S_IFIFO, 0)
|
return Mknod(path, mode|S_IFIFO, 0)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func Mkfifoat(dirfd int, path string, mode uint32) error {
|
||||||
|
return Mknodat(dirfd, path, mode|S_IFIFO, 0)
|
||||||
|
}
|
||||||
|
|
||||||
func (sa *SockaddrInet4) sockaddr() (unsafe.Pointer, _Socklen, error) {
|
func (sa *SockaddrInet4) sockaddr() (unsafe.Pointer, _Socklen, error) {
|
||||||
if sa.Port < 0 || sa.Port > 0xFFFF {
|
if sa.Port < 0 || sa.Port > 0xFFFF {
|
||||||
return nil, 0, EINVAL
|
return nil, 0, EINVAL
|
||||||
|
|||||||
Reference in New Issue
Block a user