How to wrap a system call (libc function) in Linux

For one of my research projects I had to wrap linux system calls and redirect them to another thread. In Linux system calls are not invoked directly, but rather via wrapper functions in glibc[man 2 syscalls]. The glibc wrapper is only copying arguments and unique system call number to the registers where the kernel expects them, then trapping to kernel mode and setting the errno if the system call returns an error number [man 2 intro]....

September 5, 2014 · 8 min · 1642 words · Saman Barghi

National Geographic Photo of the day Downloader for Linux

National Geographic's Photo Of the Day I am a fan of National Geographic photos on their site, and I also get bored of by my desktop background after a while. So I decided to create a script to download National Geographic photo of the day, and using it as my desktop background. I am using it over Gnome3 (I am using Fedora as I think it’s more stable than Ubuntu, and I like Gnome3 way better than Unity), but if you are a Unity user it should work for you as well....

August 29, 2012 · 2 min · 308 words · Saman Barghi

What Might My Resume look Like If I Were a Computer !?

The other day I was about to update my resume, and this crazy question came to my mind: What might my resume look like if I were a computer ? And This is the result. (Best viewed in Chrome and Firefox). Well, I am aware that I would not wake up one morning finding out I turned into a computer. Also, I am not sure if one day I turn into a computer, I would look for a job....

May 21, 2012 · 6 min · 1196 words · Saman Barghi

Some Notes on Facebook Hacker Cup Qualification Round

Monday, January 10 was the last day to submit your answers to get qualified for Facebook Hacker Cup. It started from January 7, and lasted for 3 days. There were three problems presented on the competition website, to be solved by participants. Problems were provided with sample input and output, and there were no time limits to browse through the problems and to develop your code. To answer each problem, competitors had to download an input and submit their output, yet they only had 6 minutes, after they downloaded the input, to submit their answers through the form provided....

January 11, 2011 · 6 min · 1214 words · Saman Barghi