Advanced Programming in the UNIX Environment: Week 02, Segment 4 - File Sharing

preview_player
Показать описание
In this final video lecture segment for our week 2 materials, we take a look at what it means when multiple processes access the same files and what the implications of that are on the syscalls we know. We conclude with a look at /dev/fd on different operating systems.

Outline:
00:00 Introduction
00:41 File Sharing
04:45 Atomic Operations
08:17 Shell examples
15:57 dup(2)
17:04 dup(2) code example
19:44 fcntl(2)
22:49 ioctl(2)
23:23 /dev/fd
32:13 Recap
Рекомендации по теме
Комментарии
Автор

I'm not entirely sure but the behavior shown at 31:37 doesn't happen on the Arch Linux 5.11.7 kernel.
The command: `echo foo | cat /dev/stdin/` works as expected. When trying `ls -l /dev/fd 2>&1 | cat` it shows a `pipe` instead of a `socket`.

しげお-il
Автор

Is it possible to complete the homework without calling stat? I see we don't cover it till the next week so I'm concerned I was supposed to be able to do this without calling it

adamfurbee
Автор

hi i did hw bbcp function but has failed to pass the test, regarding its output, i got some like:

Expected failure, but command returned 0:
/root/apue-code/hw/bbcp file file2

Expected failure, but command returned 0:
/root/apue-code/hw/bbcp file .

i dont know why they are expected failure cuz i think they all should work as well..

hts
Автор

Hello, I'm not a registered student but I follow the class anyway since I find it interesting and I enjoy it. Are there more classes that have lectures published on youtube and exercises and other resources on the website?

ragezor
Автор

Learning a lot... thanks.
But $27k for 6 months? Insanity...

thatcrockpot
Автор

for me, on amazon linux following works
$ # echo foo |cat /dev/stdin
foo
and I did check via strace that no socket calls were being made, as compared to other command where if I use pipe char, I can see a socket call like below:
socket(AF_UNIX, SOCK_STREAM|SOCK_CLOEXEC|SOCK_NONBLOCK, 0) = 3

vgsuresh
join shbcf.ru