[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: 1737326719807584.webm (1.51 MB, 360x638)
1.51 MB
1.51 MB WEBM
previous: >>108451485

#define __NR_setsid                112
#define __NR_getsid 124

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

tl;dr:
control process sessions

what is a session? hell if i know! but from what i understand they're important for terminals. see https://man7.org/linux/man-pages/man7/credentials.7.html

i have been wanting to dig into the guts of terminals for a while in order to learn more about what makes them tick, but my god is the documentation confusing. maybe i will try to AImaxx and have the robot explain them to me like i am retarded
anyone who knows more about this subject is super encouraged to post about it and share what you know. i would be really interested in hearing more

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/
>>
bampu
>>
i love u syscall anon
>>
>>108459728
thank u.... i wish my threads would get bumped though ;___;
>>
>>108458443
Damn, she cute but look at that fivehead.
>>
>>108458443
>what is a session? hell if i know! but from what i understand they're important for terminals.
Shouldn't this be an entirely userland-only issue? I thought the kernel only receives syscalls for interacting with the userland, and it's up to the userland how to deliver those syscalls, and how they are delivered. Or am I getting this wrong?
>>
>>108461882
sorry, i'm not entirely sure what it is you're saying here :<
>>
>>108461882
Can't transfer ownership of the shell process to the user after login without asking the kernel is the gist of it, I think?
>>
>>108458443
Is there anything more pathetic than a chink trying to be hip?
>>
>>108458443
what's a terminal you'd recommend
>>
>>108461882
No. Terminals are a special kernel object.

Every process must be associated with a typewriter (real or virtual.)
>>
>>108458443
setsid is how you make daemons
>>108461882
>>108464003
yeah terminals are really core (one should think about why X11 is different and the consequences of this design decision at this point). traditionally the terminals were all real devices (no ptys) and obviously there's a driver there. consider what is responsible for handling backspace when you're just running cat or who is responsible for handling ^C.
>>108462191
nah that's easy login is running as root and already has a controlling terminal and can easily setuid and exec the shell

terminals and job control really are the most poorly understood areas of unix
>>
>what is a session
chapter 34 in the excellent TLPI
>>
>>108463834
i use urxvt. it just werks
>>
>>108465772
i've never really read books on the subject. are they actually worth reading? if so, i might have to set aside some time and go for it. thank you for the recommendation either way, though
>>
>>108466016
the book is excellent. You don't want to read it cover to cover, only some chapters when the topic comes up in your projects or when it interests you. Much better than the man pages
>>
File: 1667302746132619.webm (1.97 MB, 576x1024)
1.97 MB
1.97 MB WEBM
>>108461391
NTA but I read your threads too.
You might generate more traffic and interest if you storytime the source with a view for further optimalisation.
Attractive images help too.
>>
>>108467782
that would require an absurd amount of effort lol
>>
>>108465772
>>108466062
nta, not the OP, but thanks for the suggestion.
>>
>>108461399
she's korean so her brain is very large, but you just have grow out her hair and give her the princess cut and it will look normal
>>
>>108470161
>effort
Definitely true.
I am fairly active on other generals that didn't go anywherem probably started by OPs bored out of their minds. The topics were interesting so I wanted to try a social experiment: add lots of contents to these and see how it went. And yes, it takes a lot of effort but the general became a lot more interesting and all in all the payback was worth it.
And now we were at page 9.
>>
>>108471752
i'm just one person lol i can't keep that up every day
it's already difficult enough to ensure i get a half decent thread out every morning before work
>>
>>108473075
>i'm just one person lol i can't keep that up every day
I am in the same position and I cannot post here from work. And quantity was never the point, it is quality that drives people to a thread and keeps them there. That and hot babes in the OP img.
>>
>>108473168
>That and hot babes in the OP img.
lol, will keep this in mind
>>
>what is a session? hell if i know!
a way to group processes (and process groups)
process groups facilitate, for example, to kill a whole pipeline `cat x | grep foo | sort ` with one system call.
Sessions, in turn, group process groups, and associate it with a terminal and multiplexes access to it. One way this is useful is this pipeline: `cat data | sudo tee mapa`. Stdin and stdout of sudo are redirected, but it can use the session to get the controlling terminal and still get the password from you out of band



[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.