[a / b / c / d / e / f / g / gif / h / hr / k / m / o / p / r / s / t / u / v / vg / vm / vmg / vr / vrpg / vst / w / wg] [i / ic] [r9k / s4s / vip] [cm / hm / lgbt / y] [3 / aco / adv / an / bant / biz / cgl / ck / co / diy / fa / fit / gd / hc / his / int / jp / lit / mlp / mu / n / news / out / po / pol / pw / qst / sci / soc / sp / tg / toy / trv / tv / vp / vt / wsg / wsr / x / xs] [Settings] [Search] [Mobile] [Home]
Board
Settings Mobile Home
/g/ - Technology


Thread archived.
You cannot reply anymore.


[Advertise on 4chan]


File: shut_it_down.mp4 (3.58 MB, 1920x1080)
3.58 MB
3.58 MB MP4
previous: >>108155678

#define __NR_shutdown            48

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

now this is a poorly named syscall if i've ever seen one! i totally thought this referred to shutting down the machine, but nope. that's reboot (even for shutdowns!)
it is quite neat that you can partially shut down the socket connection, though. sort of like an fcntl in a way, i guess

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/
>>
>>108162093
> If how is SHUT_RD, further receptions will be disallowed. If how is SHUT_WR, further transmissions will be disallowed. If how is SHUT_RDWR, further receptions and transmissions will be disallowed.
Is this useful for firewalls? What else can this be useful for?
>>
>>108162292
>What else can this be useful for?
Just graceful termination.

Also, if you ever needed proof that the designers of the socket layer had no idea what they were doing - at all: you cannot reuse a shut-down socket. Which would've been nice, y'know, to avoid having to interact with this shitty microkernel interface and pay for protection ring switches out the wazoo.
>>
>>108162311
god they love pulling shit like that
>>
>>108162610
It goes back to the original UNIX, which actually had a reason for these piecemeal interfaces:
>little memory
>thus simple memory model
>also mass storage was tape

Problem is that those were the limitations of 1969, and as such didn't exist in 1989, when NT started, or 1991, when Linux did.

Or 1982, when the 80286 released and protection ring switches were introduced, and people like Tanenbaum would still advocate for microkernels. Which, don't get me wrong, they have their use cases - but not on the x86/x64.



[Advertise on 4chan]

Delete Post: [File Only] Style:
[Disable Mobile View / Use Desktop Site]

[Enable Mobile View / Use Mobile Site]

All trademarks and copyrights on this page are owned by their respective parties. Images uploaded are the responsibility of the Poster. Comments are owned by the Poster.