On Wed, Aug 12, 2015 at 10:16 PM, Qi Wang wrote:
recently, i am checking the system call implementation. after search the go
source code, under go/src/syscall. I found that some system call does exist
for specified platform(linux,darwin etc), but the Golang doesn't provide
these system call to the Go programmer. e.g.

SYS_READV = 120 // int readv(int fd, struct iovec
*iovp, u_int iovcnt);

does exist in file zsysnum_darwin_amd64.go. while in
zsyscall_darwin_amd64.go, there is no function to invoke the readv system

this is just one example, some system call is missing from the golang
implementation. anyone knows why?
Because the standard library doesn't use it and nobody has implemented

Generally the simple system calls are all implemented because they
are, well, simple. A system call like SYS_READV is not simple to
implement in Go--it's not hard, but it's not simple. It needs a hand
written wrapper. Nobody has ever bothered to write it.

Since the syscall package is more or less frozen, nobody ever will.
But it would fine to add Readv to the golang.org/x/sys/unix package.


You received this message because you are subscribed to the Google Groups "golang-nuts" group.
To unsubscribe from this group and stop receiving emails from it, send an email to golang-nuts+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Search Discussions

Discussion Posts


Related Discussions

Discussion Navigation
viewthread | post
posts ‹ prev | 2 of 2 | next ›
Discussion Overview
groupgolang-nuts @
postedAug 13, '15 at 1:48p
activeAug 13, '15 at 4:04p

2 users in discussion

Ian Lance Taylor: 1 post Qi Wang: 1 post



site design / logo © 2021 Grokbase