@@ -1849,6 +1849,105 @@ func Dup2(oldfd, newfd int) error {
1849
1849
//sys Fsmount(fd int, flags int, mountAttrs int) (fsfd int, err error)
1850
1850
//sys Fsopen(fsName string, flags int) (fd int, err error)
1851
1851
//sys Fspick(dirfd int, pathName string, flags int) (fd int, err error)
1852
+
1853
+ //sys fsconfig(fd int, cmd uint, key *byte, value *byte, aux int) (err error)
1854
+
1855
+ func fsconfigCommon (fd int , cmd uint , key string , value * byte , aux int ) (err error ) {
1856
+ var keyp * byte
1857
+ if keyp , err = BytePtrFromString (key ); err != nil {
1858
+ return
1859
+ }
1860
+ return fsconfig (fd , cmd , keyp , value , aux )
1861
+ }
1862
+
1863
+ // FsconfigSetFlag is equivalent to fsconfig(2) called
1864
+ // with cmd == FSCONFIG_SET_FLAG.
1865
+ //
1866
+ // fd is the filesystem context to act upon.
1867
+ // key the parameter key to set.
1868
+ func FsconfigSetFlag (fd int , key string ) (err error ) {
1869
+ return fsconfigCommon (fd , FSCONFIG_SET_FLAG , key , nil , 0 )
1870
+ }
1871
+
1872
+ // FsconfigSetString is equivalent to fsconfig(2) called
1873
+ // with cmd == FSCONFIG_SET_STRING.
1874
+ //
1875
+ // fd is the filesystem context to act upon.
1876
+ // key the parameter key to set.
1877
+ // value is the parameter value to set.
1878
+ func FsconfigSetString (fd int , key string , value string ) (err error ) {
1879
+ var valuep * byte
1880
+ if valuep , err = BytePtrFromString (value ); err != nil {
1881
+ return
1882
+ }
1883
+ return fsconfigCommon (fd , FSCONFIG_SET_STRING , key , valuep , 0 )
1884
+ }
1885
+
1886
+ // FsconfigSetBinary is equivalent to fsconfig(2) called
1887
+ // with cmd == FSCONFIG_SET_BINARY.
1888
+ //
1889
+ // fd is the filesystem context to act upon.
1890
+ // key the parameter key to set.
1891
+ // value is the parameter value to set.
1892
+ func FsconfigSetBinary (fd int , key string , value []byte ) (err error ) {
1893
+ if len (value ) == 0 {
1894
+ return EINVAL
1895
+ }
1896
+ return fsconfigCommon (fd , FSCONFIG_SET_BINARY , key , & value [0 ], len (value ))
1897
+ }
1898
+
1899
+ // FsconfigSetPath is equivalent to fsconfig(2) called
1900
+ // with cmd == FSCONFIG_SET_PATH.
1901
+ //
1902
+ // fd is the filesystem context to act upon.
1903
+ // key the parameter key to set.
1904
+ // path is a non-empty path for specified key.
1905
+ // atfd is a file descriptor at which to start lookup from or AT_FDCWD.
1906
+ func FsconfigSetPath (fd int , key string , path string , atfd int ) (err error ) {
1907
+ var valuep * byte
1908
+ if valuep , err = BytePtrFromString (path ); err != nil {
1909
+ return
1910
+ }
1911
+ return fsconfigCommon (fd , FSCONFIG_SET_PATH , key , valuep , atfd )
1912
+ }
1913
+
1914
+ // FsconfigSetPathEmpty is equivalent to fsconfig(2) called
1915
+ // with cmd == FSCONFIG_SET_PATH_EMPTY. The same as
1916
+ // FconfigSetPath but with AT_PATH_EMPTY implied.
1917
+ func FsconfigSetPathEmpty (fd int , key string , path string , atfd int ) (err error ) {
1918
+ var valuep * byte
1919
+ if valuep , err = BytePtrFromString (path ); err != nil {
1920
+ return
1921
+ }
1922
+ return fsconfigCommon (fd , FSCONFIG_SET_PATH_EMPTY , key , valuep , atfd )
1923
+ }
1924
+
1925
+ // FsconfigSetFd is equivalent to fsconfig(2) called
1926
+ // with cmd == FSCONFIG_SET_FD.
1927
+ //
1928
+ // fd is the filesystem context to act upon.
1929
+ // key the parameter key to set.
1930
+ // value is a file descriptor to be assigned to specified key.
1931
+ func FsconfigSetFd (fd int , key string , value int ) (err error ) {
1932
+ return fsconfigCommon (fd , FSCONFIG_SET_FD , key , nil , value )
1933
+ }
1934
+
1935
+ // FsconfigCreate is equivalent to fsconfig(2) called
1936
+ // with cmd == FSCONFIG_CMD_CREATE.
1937
+ //
1938
+ // fd is the filesystem context to act upon.
1939
+ func FsconfigCreate (fd int ) (err error ) {
1940
+ return fsconfig (fd , FSCONFIG_CMD_CREATE , nil , nil , 0 )
1941
+ }
1942
+
1943
+ // FsconfigReconfigure is equivalent to fsconfig(2) called
1944
+ // with cmd == FSCONFIG_CMD_RECONFIGURE.
1945
+ //
1946
+ // fd is the filesystem context to act upon.
1947
+ func FsconfigReconfigure (fd int ) (err error ) {
1948
+ return fsconfig (fd , FSCONFIG_CMD_RECONFIGURE , nil , nil , 0 )
1949
+ }
1950
+
1852
1951
//sys Getdents(fd int, buf []byte) (n int, err error) = SYS_GETDENTS64
1853
1952
//sysnb Getpgid(pid int) (pgid int, err error)
1854
1953
0 commit comments