Power of plain text, the power of being simple

As we see the convergence of technologies through web, I think plain text is going to play a crucial role in delivering a standard cross platform solution for communication. It has already taken the center stage in form of XML. Debate on simplicity (or human side of technology) and performance will, I think, have a [...]

failed to retrieve keys – Automatix !

After installing Automatix on the Ubuntu, when I started it , it sleeps for some time (seemingly) and then says – failed to retrieve keys.
Looking at the `ps -aef’ output I could find that it has been trying to get the keys with a timeout value and when the timeout occurs, it shows the error.
So [...]

return and exit from main: difference

What is the difference between returning from main with some exit code and calling exit giving the exit code as parameter ?
Basically the difference between following programs !
//ret.c
int main()
{
return 43;
}
//exit.c
int main()
{
exit(43);
}
well, there are three ways for the processes to exit: -
1. Voluntary exit (implicit)
2. Voluntary exit (explicit)
3. Involunatary exit
Voluntary exit can be implicit [...]

fork and vfork

quick question: what’s the difference between fork() and vfork() system calls ?
quick answer: vfork() system call creates a process that shares the memory address space of its parent.
details:
fork() is implemented by linux as a clone() system call whose flags parameter specifies both a SIGCHLD signal and all the clone flags cleared and whose child_stack parameter [...]

difference between jmp and far jmp

a quick question in interviews: what is the difference between jmp and far jmp ?
a quick answer: far jmp modified both CS and EIP while jmp modifies only EIP.

handling interrupts stackability

An interrupt is an asynchronous event caused by devices to the kernel which must be processed urgently and in system context. Since this is not handled in process context, this cannot access u area and other process specific data structures. Only penalty that the interrupted process makes is that interrupt handling uses the time slice [...]

setting effective UID/GID on linux

There are several ways to change the real or effective UID/GID of a process: -
* exec system call, when used to execute a program installed in suid (set uid) mode, changes the effective UID of the process to the effective UID of the owner of the program file. This the trick used by passwd program. [...]

UID, GID – real and effective – difference !

Reading the book by Uresh Vahalia, Unix Internals, I could understand exactly what is the concept behind real and effective UID and GID. I immediately thought of blogging it for reference.
The effective UID and effective GID affect file creation and access. During file creation, the kernel sets the owner attributes of the file to the [...]

setting DISPLAY on linux while ssh’ing

If you are also fed up of exporting DISPLAY manually everytime you need to use gvim or anything else requiring ‘X’ then you will get a relief reading this post. you can use -X option
ssh -X [IP | Host]
If you use ssh -X, ssh will tunnel your X connection for you and automatically set [...]

verifying user space addresses in kernel

We can verify a user space address while executing in kernel by using the following function
int access_ok(int type, const void *addr, unsigned long size);
Defined in <asm/uaccess.h>, this function returns 1 if the address addr is a user space address and 0 if its a kernel space address (talking of the virtual address of course). argument [...]