[Linux][C]How to specify a process as the owner of the file ?


When a process invokes F_SETOWN command using fnctl system call, the process ID of the owner process is saved in filp->f_owner which can be used to address the file . Usage eg:-      fd = open(“/dev/filename”, O_RDONLY);         if (fd < 0) {                fprintf(stderr, ” failed to open /dev/filename \n”);                return;        }         if ((fcntl(fd,Continue reading “[Linux][C]How to specify a process as the owner of the file ?”

[Linux]What is Thundering herd problem in Linux point of view ?


We studied about the forms of wait_event and wake_up macros in Linux device driver text book. These macros are used to sleep the process while waiting for an event and  wake up from the sleep state when even occurs . So when a process calls wake_up on a wait queue, all processes waiting on thatContinue reading “[Linux]What is Thundering herd problem in Linux point of view ?”

[Linux driver]A Little about put_user & __put_user


  put_user and __put_user used to write the datum to user space Function Declaration of put_user => put_user(datum, ptr)           Function Declaration of __put_user => __put_user(datum, ptr) When single values are to be transferred, put_user/ __put_user should be called instead copy_to_user . Reason behind this is        these functions(put_user/__put_user ) are relatively fast.   DifferenceContinue reading “[Linux driver]A Little about put_user & __put_user”

[Linux][C]What is the reason for returning -ENOTTY for incorrect ioctl command ?


There is a system call fcntl which is very similar to the system call ioctl.But it is kept separate from ioctl for following reasons: when Unix developers faced the problem of controlling I/O operations , they decided that files and devices were different. At the time, the only devices with ioctl implementations were ttys  Continue reading “[Linux][C]What is the reason for returning -ENOTTY for incorrect ioctl command ?”

[Linux][C]What should the default section be when the command number in driver ioctl function doesn’t match a valid operation ?


According to POSIX standard, if an inappropriate ioctl command has been issued , then -ENOTTY should be returned. The error code for -ENOTTY is ” inappropriate ioctl for device” But it is common that the error code for -EINVAL returns on the default section of ioctl switch statement, which says “invalid ioctl command” .  Continue reading “[Linux][C]What should the default section be when the command number in driver ioctl function doesn’t match a valid operation ?”

[Linux]Significance of rc.local


This script will be executed *after* all the other init scripts. We can put  the customized script  here, which needed to be run after system up. Also depending upon run level , there will be a local file. Like if System’s runlevel is 5 /etc/rc5.d/S99local is the file . There you can put the script whichContinue reading “[Linux]Significance of rc.local”

[Windows]How to open the task manager on a windows remote desktop session


There are many ways to open task manager on a Windows remote desktop session 1) Press Ctrl-Shift-ESC 2) Right-click the taskbar and click Task Manager. 3) click Start → Run, then type taskmgr.