3 ms·
'>>' will cause O_APPEND to be specified as flags when opening "/dev/sda". I'm pretty sure this flag is ignored on block devices as it's obviously useless.
by cnvogel 11y ago
'>>' will cause O_APPEND to be specified as flags when opening "/dev/sda". I'm pretty sure this flag is ignored on block devices as it's obviously useless.
fd = open("/dev/sda", O_WRONLY|O_CREAT|O_NOCTTY|O_APPEND, 0644);
pos = lseek(fd, 0, SEEK_CUR);
-> pos = 0
http://hastebin.com/abuhiwivoz.pl http://hastebin.com/abuhiwivoz.pl
# tmp sudo ./open_sda
Current position after open: 0
Current position after seek to end: 128035676160