No open file or directory syscall error

I created a folder "progfiles" on the desktop and then created an empty document named "newfile.txt" in it. After that I wrote a program to open and read write newfile.txt but on running error occured on checking errno it gave error &q

Run the js node from php shell_exec ()

Hi I uploded some files to parse which parsed by node js. currently I am running it from terminal as node app.js. I need to call it from my php model. I am thinking shell_exec() function will help. I tried like this shell_exec('

rmdir (2) used for deleting the directory tree

If a particular filesystem supports cheap removal of whole directories (with everything inside), would it be acceptable by POSIX / Linux / de-facto standards to let rmdir syscall delete a directory successfully even if it was not empty? Manpage for r

error when using open () in CUDA C

I try to open a file in CUDA C fd = open("stats.txt", O_CREAT) The open() is supposed to run in host side, compilation passed but there was a link error. In function `open': /usr/include/x86_64-linux-gnu/bits/fcntl2.h:45: undefined reference to

Do I need to allocate memory before using these system calls?

I always see this functions called without allocate memory for path, dir, buf and name. char *getcwd(char *path, size_t size); struct dirent *readdir(DIR *dir); int stat(const char *file_name, struct stat *buf); DIR *opendir(const char *name); Why? D

What is meant by & ldquo; blocking the system call & quot;?

What is the meaning of "blocking system call"? In my operating systems course, we are studying multithreaded programming. I'm unsure what is meant when I read in my textbook "it can allow another thread to run when a thread make a blocking

Run the process through the Java program

I am working in java for Ubuntu environment. I want to execute a script file but through java program. I have tried followings try{ Runtime.getRuntime().exec("/usr/lib/flume-ng/bin/flume-ng agent -f /home/c4/Flume/New/ClientAgent.config -n clientAgen

Write and read, socket AF_UNIX in C

I'm writing some socket functions in C but I encounter this problem. I have a struct with three fields: typedef struct { char type; unsigned int length; char *buffer; } message_t; I need to wrap in the same string (type,length,buffer) and write it at

System calls managing directories

In order to implement some security measures in a User-mode-Linux kernel, I am trying to edit system calls, such as opendir and readdir, that would control directories so that I can guarantee a certain directory that can't be reached. Where can I fin

Implementing system calls

If a user application makes a system call , a software interrupt/exception is triggered. How can I see the source code for generating a software interrupt ?It is explained in Linux Assembly Howto. And you should read wikipedia syscall page (and also

measure number of page faults in a program on Linux

I am doing a project on Linux scheduler that tries to minimize number of page faults. I have finished the algorithm implementation, and I need to measure the effect. I am wondering if Linux provides tools to the record number of page faults that have

Name_to_handle_at logic ()

I am not getting much information on the new system call name_to_handle_at() and open_to_handle_at(). Can anyone help me out here. Thanks An Edit. I just have this functions are useful for writing u

What does sys_break do?

I was reading the list of Linux system calls and found sys_break, whose description is as follows. Syntax: int sys_break() Source: kernel/sys.c Action: return -ENOSYS Details: call exists only for compatibility Does anyone know what sys_break do? Or

How can I call the system write () print on the screen?

For my OS class I'm supposed to implement Linux's cat using only system calls (no printf) Reading this reference I found it being used to print to a file. I guess I should manipulate ofstream. In the example appears: ofstream outfile ("new.txt",

System calls on Windows

I just want to ask, I know that standart system calls in Linux are done by int instruction pointing into Interrupt Vector Table. I assume this is similiar on Windows. But, how do you call some higher-level specific system routines? Such as how do you

How to write a signal manager to catch SIGSEGV?

I want to write a signal handler to catch SIGSEGV. I protect a block of memory for read or write using char *buffer; char *p; char a; int pagesize = 4096; mprotect(buffer,pagesize,PROT_NONE) This protects pagesize bytes of memory starting at buffer a

Assembly and system calls

Im having a bit of trouble understanding the more complex system calls in assembly. I wrote a exec system call and it worked great .bss .text .globl _start _start: #exit(0) system call movl $1, %rax movl $0, %rbx int $0X80 Though I am a bit insure an

Problem Replacing Linux System Calls Using LD_PRELOAD

I am trying to write a program that allows a binary to be run, substituting a certain file when requested with another. It is a library with simple replacements for the system call functions, that is used with LD_PRELOAD. The problem is that it catch