previous: >>108084144#define __NR_alarm 37https://man7.org/linux/man-pages/man2/alarm.2.htmlgod i hate async. signals too.it's strange that this is preserved across an exec. why?relevant 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_alarm 37
man man
man syscalls
desu, this syscall is so dumb that i wouldn't even feel bad if no one replied to this thread. it's when there's ACTUALLY interesting stuff happening that it's a bit disheartening
>alarm() and setitimer(2) share the same timer; calls to one will interfere with use of the other.>sleep(3) may be implemented using SIGALRM; mixing calls to alarm() and sleep(3) is a bad idea.
>>108092980alarm() and setitimer(2) share the same timer; calls to one will interfere with use of the oher.interfere with each other like how exactly? If I have two separate processes running and one uses alarm() and the other setitimer(), do they interfere? Does one cancel the other? Isn't that a big security risk?
>>108094167>interfere with each other like how exactly?https://elixir.bootlin.com/linux/v6.18.6/source/kernel/time/itimer.c#L327>If I have two separate processes running and one uses alarm() and the other setitimer(), do they interfere?no, because they are separate processes
>>108066842with this one I find it interesting that it returns -1, even though it's expected behaviour. It makes sense from a certain point of view, but I don't agree with it.>>>108077803ignore that person, he was being unnecessarily rude (and retarded, too! shocker!)>>108092980>it's strange that this is preserved across an exec. why?maybe you've exec'd some heavy process that you don't want to eat up too much time.but very funny syscall. Send it off and forget about it and be bitten in the arse by it some time later. I'd prefer to do this in userspace, but it has a hacky niceness to it it shares with other early day syscalls.
>>108093118I'm sorry, I wasn't around for a couple of days:(I always find these very delightful
>>108095455>with this one I find it interesting that it returns -1, even though it's expected behaviour. It makes sense from a certain point of view, but I don't agree with it.lol yeah. i could totally see the argument for either always returning 0 or -1, but i agree it feels a bit strange. >maybe you've exec'd some heavy process that you don't want to eat up too much time.i just think it's really strange the sets of things that are/aren't preserved across forks, execs, etc. and some things are only partially preserved! it's quite interesting>>108095468i will forgive u just this once.....
>>108095535>it's quite interestingand an absolute mess to think about when using exec with complex programme state
>>108092980thought that was a penis when i saw it on the catalog
>>108097239sorry to disappoint