Skip to content

x/sys/unix: missing Fallocate constants #10599

@spakin

Description

@spakin

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

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions