previous: >>108582499#define __NR_vhangup 153https://man7.org/linux/man-pages/man2/vhangup.2.htmltl;dr:virtually hup a terminali went to the archives to double check that i hadn't included this one in a previous thread, and from what i can see, it looks like no one has ever posted the term "vhangup" to /g/ before... really interesting. i wonder to how many syscalls that applies?anyway, i read the manpage, and to be perfectly honest with you, i'm still not really sure what this syscall does. i was never good with terminals. the low level details really confuse me... i need to take that one anon's advice from a few threads back and read the chapters from the classic book on it. there were go, found it: https://desuarchive.org/g/thread/108458443/#108465772chapter #34 in TLPIi wonder if that anon is still around and might have anything to add? otherwise, i might just poke around on bootlin and see what exactly is happening in the source for this guyrelevant resources: man manman syscallshttps://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/
#define __NR_vhangup 153
man man
man syscalls
Nice pic assholeDeviant plus alcoholic...
>>108590087yep, that's meyou're probably wondering how i got here
i dont know what these threads are about but keep posting, the pics are cool.
>>108589999>heartbroken nekomimi meido;_;Anyway, this sounds like a way to disconnect from a connected terminal without killing the current process. I don't get why this can't be done with raise(SIGHUP); , though.
raise(SIGHUP);
these syscalls always remind you of how hilariously outdated many of the unix primitives are
>>108590248Wait, never mind, raise(SIGHUP); would kill the current process.
>>108590248she's just like me fr>>108590254yeah, there's a whole lot of cruft i'm discovering
>>108590254>>108590267I'm not surprised. Unix started as essentially a toy project in the late 60s and then got too popular to break backwards compatibility, so any new and improved interfaces were just piled on top of everything else that already existed. The POSIX C time API, for example, is particularly messy.
I don'get it either. If the hangup is simulated, how does the user get a clean terminal? What even does "simulated" mean in this context? Confusing.
>>108590306I just tried it and got the "Operation not permitted" errno.
>>108590337you've gotta sudo it
>>108590341It seems to just kill the process with a SIGHUP without executing any following code.
>>108589999Also notable about this syscall is that it seems to be Linux-specific. I can't find a POSIX manpage for it.
>>108589999How is this different from just closing the file descriptors for the terminal?
>>108590361try setting SIGHUP to ignored and see what happens?https://elixir.bootlin.com/linux/v6.19.11/source/drivers/tty/tty_io.c#L680
>>108590361>>108590440oh, and, here's the wrapperhttps://elixir.bootlin.com/linux/v6.19.11/source/fs/open.c#L1588
>>108590112if you were a real woman I could save you
>>108590482it's ok im actually pretty happy these days and don't need saving but y'know, at least you tried
>>108589999I don't really get what this does, the man page for login mentions this :> A recursive login, as used to be possible in the good old days, no longer works; for most purposes su(1) is a satisfactory substitute. Indeed, for security reasons, login does a vhangup(2) system call to remove any possible listening processes on the tty. This is to avoid password sniffing. If one uses the command login, then the surrounding shell gets killed by vhangup(2) because it’s no longer the true owner of the tty. This can be avoided by using exec login in a top-level shell or xterm.
>>108590112tell us
>>108590434you would have to do it for all processes in the session, or at least in the foreground process group (I think). I assume this syscall enforces this for you
>>108590434>>108591572how is this different than just calling revoke on the tty?
>>108592263so far, no one seems to know
>>108592263apparently revoke does not really exist on linux, which is kind of surprising. glibc has the function but it always fails with ENOSYS, and there is no revoke system call. In order to revoke access to a terminal you have to either use this syscall or the TIOCVHANGUP ioctl on the terminal.