Details
-
SkillsA lot
-
LocationBangalore
Joined devRant on 9/26/2020
Join devRant
Do all the things like
++ or -- rants, post your own rants, comment on others' rants and build your customized dev avatar
Sign Up
Pipeless API
From the creators of devRant, Pipeless lets you power real-time personalized recommendations and activity feeds using a simple API
Learn More
-
I had the nerve to ask “Do you have any reservations about hiring me?” during an interview today. No regrets. Recommend.21
-
fork() can fail: this is important
Ah, fork(). The way processes make more processes. Well, one of them, anyway. It seems I have another story to tell about it.
It can fail. Got that? Are you taking this seriously? You should. fork can fail. Just like malloc, it can fail. Neither of them fail often, but when they do, you can't just ignore it. You have to do something intelligent about it.
People seem to know that fork will return 0 if you're the child and some positive number if you're the parent -- that number is the child's pid. They sock this number away and then use it later.
Guess what happens when you don't test for failure? Yep, that's right, you probably treat "-1" (fork's error result) as a pid.
That's the beginning of the pain. The true pain comes later when it's time to send a signal. Maybe you want to shut down a child process.
Do you kill(pid, signal)? Maybe you do kill(pid, 9).
Do you know what happens when pid is -1? You really should. It's Important. Yes, with a capital I.
...
...
...
Here, I'll paste from the kill(2) man page on my Linux box.
If pid equals -1, then sig is sent to every process for which the calling process has permission to send signals, except for process 1 (init), ...
See that? Killing "pid -1" is equivalent to massacring every other process you are permitted to signal. If you're root, that's probably everything. You live and init lives, but that's it. Everything else is gone gone gone.
Do you have code which manages processes? Have you ever found a machine totally dead except for the text console getty/login (which are respawned by init, naturally) and the process manager? Did you blame the oomkiller in the kernel?
It might not be the guilty party here. Go see if you killed -1.
Unix: just enough potholes and bear traps to keep an entire valley going.
Source: https://rachelbythebay.com/w/2014/...12 -
One big advantage of being an adult is that you can spend all day before the PC without having parents nagging.18
-
Trying to reverse engineer an API.
Who on fucking earth thought it would be a good idea to let the response be JSON but.... THE VALUE OF THE MAIN INFORMATION THING/KEY PLAIN (UGLY AS HELL) HTML WITH EVEN GOOGLE TAGS BULLSHIT...
WHY?! THIS HURTS.
EHVIENZJVYENWBFFJSJZ 💀12 -
All the stupid date functions where the days range from 1 to 31 but the months range from 0 to 1120
-
This motherfucker tried to fuck me!
Ok, here's the full story.
I applied for a quick job as freelancer. He told me I just had to implement stripe payment gateway. After finishing that he asked to save the user data from payment to the database, too. I added that. All the way he wanted me to work on his ugly project on a rotten server through cpanel. But I refused instead I uploaded a showcase environment on my own server.
After he tested my code and all was working as expected he again tried to make me implement the code right away into his retarded project before payment. When I mentioned that he has to pay me first he started bitching that he won't pay in advance.
At this point I left that fucker. Knowing that my feeling was right and this bitch never had the intention to pay for my work. He just wanted to steel my code.
Fuck you. I hope you get eaten in your bed by very hungry slugs one day. Like this one guy here on devrant.19 -
So, at my company we are migrating from "master" branch on github.
It's good to know we are defeating racism.51