jcs's openbsd hax
openbsd
at jcs 203 lines 4.7 kB view raw
1.\" $OpenBSD: fuse_reply_err.3,v 1.1 2026/02/01 20:02:58 helg Exp $ 2.\" 3.\" Copyright (c) 2026 Helg Bredow <helg@openbsd.org> 4.\" 5.\" Permission to use, copy, modify, and distribute this software for any 6.\" purpose with or without fee is hereby granted, provided that the above 7.\" copyright notice and this permission notice appear in all copies. 8.\" 9.\" THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES 10.\" WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF 11.\" MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR 12.\" ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES 13.\" WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN 14.\" ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF 15.\" OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. 16.\" 17.Dd $Mdocdate: February 1 2026 $ 18.Dt FUSE_REPLY_ERR 3 19.Os 20.Sh NAME 21.Nm fuse_reply_err , 22.Nm fuse_reply_buf , 23.Nm fuse_reply_attr , 24.Nm fuse_reply_open , 25.Nm fuse_reply_write , 26.Nm fuse_reply_entry , 27.Nm fuse_reply_statfs , 28.Nm fuse_reply_readlink 29.Nd send replies to FUSE requests 30.Sh SYNOPSIS 31.Lb libfuse 32.In fuse_lowlevel.h 33.Ft int 34.Fo fuse_reply_err 35.Fa "fuse_req_t req" 36.Fa "int errno" 37.Fc 38.Ft int 39.Fo fuse_reply_buf 40.Fa "fuse_req_t req" 41.Fa "const char *buf" 42.Fa "off_t size" 43.Fc 44.Ft int 45.Fo fuse_reply_attr 46.Fa "fuse_req_t req" 47.Fa "const struct stat *attr" 48.Fa "double attr_timeout" 49.Fc 50.Ft int 51.Fo fuse_reply_open 52.Fa "fuse_req_t req" 53.Fa "const struct fuse_file_info *fi" 54.Fc 55.Ft int 56.Fo fuse_reply_write 57.Fa "fuse_req_t req" 58.Fa "size_t count" 59.Fc 60.Ft int 61.Fo fuse_reply_entry 62.Fa "fuse_req_t req" 63.Fa "const struct fuse_entry_param *e" 64.Fc 65.Ft int 66.Fo fuse_reply_statfs 67.Fa "fuse_req_t req" 68.Fa "const struct statvfs *stbuf" 69.Fc 70.Ft int 71.Fo fuse_reply_readlink 72.Fa "fuse_req_t req" 73.Fa "char *linkname" 74.Fc 75.Sh DESCRIPTION 76These functions are used in the FUSE low-level API to send responses to 77requests received from the kernel. 78.Pp 79Once called, the request is considered handled and must not be replied to 80again. 81.Bl -tag -width Ds 82.It Fn fuse_reply_err "req" "errno" 83Send an error response to the request 84.Fa req . 85The 86.Fa errno 87parameter must be a valid (non-negated) error number, for example 88.Er ENOENT 89or 90.Er EACCES .. 91.Pp 92This is a valid response for all file system operations. 93.It Fn fuse_reply_buf "req" "buf" "size" 94Send a buffer 95.Fa buf 96of 97.Fa size 98bytes of data to the kernel. 99.Pp 100This is a valid response for 101.Fn read 102and 103.Fn readdir 104operations. 105.It Fn fuse_reply_attr "req" "attr" "attr_timeout" 106Replies with file attributes specified in 107.Fa attr , 108valid for 109.Fa attr_timeout 110seconds. 111The 112.Ox 113kernel does not currently support attribute caching and 114.Fa attr_timeout 115will be ignored. 116.Pp 117This is a valid response for 118.Fn getattr 119and 120.Fn setattr 121operations. 122.It Fn fuse_reply_open "req" "ffi" 123Send a response to an open request with the file info structure 124.Fa ffi . 125Only the 126.Fa fh 127member of 128.Fa ffi 129is used. 130.Pp 131This is a valid response for 132.Fn open 133and 134.Fn opendir 135operations. 136.It Fn fuse_reply_write "req" "count" 137Reply to a write request with the 138.Fa count 139of bytes written. 140.Pp 141This is a valid response for the 142.Fn write 143operation. 144.It Fn fuse_reply_entry "req" "e" 145Reply to a lookup or other request that results in new file creation with 146the details of the new directory entry 147.Fa e , 148which is defined as follows: 149.Bd -literal 150struct fuse_entry_param { 151 ino_t ino; /* inode number of the entry */ 152 unsigned long generation; /* must be non-zero */ 153 struct stat attr; /* attributes of the entry */ 154 double attr_timeout; /* ignored */ 155 double entry_timeout; /* ignored */ 156}; 157.Ed 158.Pp 159The 160.Ox 161kernel does not currently cache FUSE lookups or attributes and the 162.Fa attr_timeout 163and 164.Fa entry_timeout 165members are ignored. 166.Pp 167This is a valid response for the 168.Fn lookup , 169.Fn mknod , 170.Fn mkdir , 171.Fn symlink , and 172.Fn link 173operations. 174.It Fn fuse_reply_statfs "req" "stbuf" 175Reply with file system statistics provided in 176.Fa stbuf . 177.Pp 178This is a valid response for the 179.Fn statfs 180operation. 181.It Fn fuse_reply_readlink "req" "link" 182Replies to a readlink request with the symbolic link path 183.Fa link . 184The target string cannot contain the NUL character. 185.Pp 186This is a valid response for the 187.Fn readlink 188operation. 189.El 190.Sh RETURN VALUES 191All functions return 0 on success. 192On failure, they return 193.Pf \- Va errno 194to indicate the error. 195.Sh SEE ALSO 196.Xr fuse_lowlevel_new 3 197.Sh STANDARDS 198These library functions conform to FUSE 2.6. 199.Sh HISTORY 200These library functions have been available since 201.Ox 7.9 . 202.Sh AUTHORS 203.An Helg Bredow Aq Mt helg@openbsd.org