Thread #108301681
HomeIndexCatalogAll ThreadsNew ThreadReply
H
previous: >>108292753

#define __NR_truncate            76
#define __NR_ftruncate 77

https://man7.org/linux/man-pages/man2/truncate.2.html

tl;dr:
set a file to a specific length

that's all you're getting from me today because i'm in a rush
only other thing i will add is it's pretty bizarre (from a naming perspective) that you can "truncate" a file to a larger size

relevant resources:
man man

man syscalls

https://man7.org/linux/man-pages/
https://linux.die.net/man/
https://elixir.bootlin.com/linux/
https://elixir.bootlin.com/musl/
https://elixir.bootlin.com/glibc/
+Showing all 2 replies.
>>
The name is bizarre, but how else would you enlarge a file that you only ever map into your process? If you don't write() to it it never gets bigger.

Hence the ftruncate.
>>
Bump.

Reply to Thread #108301681


Supported: JPG, PNG, GIF, WebP, WebM, MP4, MP3 (max 4MB)