proc_create_net_data_write(9)
π
proc_create_net_data_write(9) β a Kernel API Manual kiki β¨
okay bestie, welcome to the Kernel API Manual corner of the kernel. this page is about proc_create_net_data_write, and it's giving βmake me a writable proc file that's net_ns-specificβ energy. let's get into it π
πΈ NAME πΈ
proc_create_net_data_write β create a writable net_ns-specific proc file, periodt. π
β¨ SYNOPSIS β¨
struct proc_dir_entry * proc_create_net_data_write (const char *name ,
umode_t mode , struct proc_dir_entry *parent , const struct
seq_operations *ops , proc_write_t write , unsigned int state_size ,
void *data );
π ARGUMENTS π
nameβ the name of the file. like its whole label, no cap.modeβ the file's access mode. the mode bits vibe, iykyk.parentβ the parent directory in which to create. where the file lives.opsβ theseq_fileops with which to read the file. these do the reading magic.writeβ the write method with which to 'modify' the file. yes, 'modify' in quotes.state_sizeβ the size of the per-file private state to allocate. allocate that private state, bestie.dataβ data for retrieval bypde_data. it's giving payload.
π¦ DESCRIPTION π¦
okay so the whole point: create a network namespaced proc file in the parent directory, with the specified name and mode. it allows reading of a file that displays a series of elements, and it also provides for the file accepting writes that have some arbitrary effect. main character behavior, honestly.
the functions in the ops table are used to iterate over items to be presented and extract the readable content using the seq_file interface. that's the reading pipeline, slay.
the write function is called with the data copied into a kernel space scratch buffer and has a NUL appended for convenience. the buffer may be modified by the write function. write should return 0 on success. that's the success vibe check: 0.
the data value is accessible from the show and write functions by calling pde_data on the file inode. and the network namespace must be accessed by calling seq_file_net on the seq_file struct. not optional, bestie β that's the rule.
π SEE ALSO π
- Kernel file
./fs/proc/proc_net.cβ go peek, iykyk π proc_create_net_single_write(9)β also on the SEE ALSO list, go say hi π«Ά
π and that's a wrap! source/version: ./fs/proc Β· date: October 2026 Β· page: proc_create_net_data_write(9) Β· mwah, bye bestie π
π¦ where this page comes from
- nixpkgs unstable: linux-manual 7.3.1
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms