Skip to content

x/sys/unix: missing Fallocate constants #10599

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

Closed
spakin opened this issue Apr 28, 2015 · 6 comments
Closed

x/sys/unix: missing Fallocate constants #10599

spakin opened this issue Apr 28, 2015 · 6 comments

Comments

@spakin
Copy link

spakin commented Apr 28, 2015

I'd like to use the Fallocate function from golang.org/x/sys/unix but found that it's missing the FALLOC_FL_* constants from /usr/include/linux/falloc.h. I believe the following patch to golang.org/x/sys/unix/mkerrors.sh should address the issue:

--- golang.org/x/sys/unix/mkerrors.sh.ORIG      2015-04-28 15:43:03.195157047 -0600
+++ golang.org/x/sys/unix/mkerrors.sh   2015-04-28 15:41:41.207778564 -0600
@@ -102,6 +102,7 @@
 #include <sys/types.h>
 #include <sys/time.h>
 #include <sys/socket.h>
+#include <linux/falloc.h>
 #include <linux/if.h>
 #include <linux/if_arp.h>
 #include <linux/if_ether.h>
@@ -272,6 +273,7 @@
                $2 ~ /^IN_/ ||
                $2 ~ /^LOCK_(SH|EX|NB|UN)$/ ||
                $2 ~ /^(AF|SOCK|SO|SOL|IPPROTO|IP|IPV6|ICMP6|TCP|EVFILT|NOTE|EV|SHUT|PROT|MAP|PACKET|MSG|SCM|MCL|DT|MADV|PR)_/ ||
+                $2 ~ /^FALLOC_/ ||
                $2 == "ICMPV6_FILTER" ||
                $2 == "SOMAXCONN" ||
                $2 == "NAME_MAX" ||

Thanks,
— Scott

@ianlancetaylor ianlancetaylor added this to the Go1.5Maybe milestone Apr 29, 2015
@minux minux changed the title Missing Fallocate constants in golang.org/x/sys/unix x/sys/unix: missing Fallocate constants May 2, 2015
@minux minux modified the milestones: Unreleased, Go1.5Maybe May 2, 2015
@tchernomax
Copy link

This issue is still present in latest source.
Does the proposed patch have some error ?
Can you (go commiter) give us some feedback ?

@ALTree
Copy link
Member

ALTree commented Jan 19, 2017

Usually patches sent to the issue tracker are not looked at; patches should be sent via gerrit, see contribuing - code review.

@grzegorz-zur
Copy link

I looked at similar issues #15114 and #16816 on fadvise syscall constants. As far as I understand, the fix would be to manually add the constants in the go.googlesource.com/sys project instead of changing mkerrors.sh script. Is it correct?

@ianlancetaylor
Copy link
Contributor

No, it would be better to change the relevant script.

@tchernomax
Copy link

I just submitted the patch to gerrit:
https://go-review.googlesource.com/#/c/36336/

(by the way: the contribution procedure to golang is a pain in the ass)

@gopherbot
Copy link
Contributor

CL https://golang.org/cl/36336 mentions this issue.

@golang golang locked and limited conversation to collaborators Feb 13, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

8 participants