4

What is fildes and in linux, what is the difference between file descriptor and fildes. For example, the below write deals with file descriptor

ssize_t write(int fd, const void *buf, size_t count);

Where as the below pwrite deals with fildes

ssize_t pwrite(int fildes, const void *buf, size_t nbyte, off_t offset); 

2 Answers 2

7

These are just parameter names. They both refer to file descriptor.

Read manual for those functions

man 2 write
man pwrite
1

generally In functions like

foo(int a, int b); or foo1(int x, int y);

no need to ask that what is a and what is x (by simply seeing the declaration ). So consider the type only , name associated with type is just identifier in the parameter list which is used inside the function.

In your case both fd and fildes are file descriptors.

Not the answer you're looking for? Browse other questions tagged or ask your own question.