I'm using the following code to try to read the results of a df command in Linux using popen.
#include <iostream> // file and std I/O functions
int main(int argc, char** argv) {
FILE* fp;
char * buffer;
long bufSize;
size_t ret_code;
fp = popen("df", "r");
if(fp == NULL) { // head off errors reading the results...
Hi, this is for an assignment at school, where I need to determine the size of the processes on the system using a system call. My code is as follows:
...
struct task_struct *p;
struct vm_area_struct *v;
struct mm_struct *m;
read_lock(&tasklist_lock);
for_each_process(p) {
printk("%ld\n", p->pid);
m = p->mm;
v = m->mmap;
...
I need to append my public key (which is in a variable) in pubring of .gnupg using the system call in PHP. What system call is available for this?
$gpg = system('gpg --recipient userid --output outfile.asc --armor --encrypt hello.txt', $retvalue);//calling gpg encrypt command using system call
echo '
Output: ' . $gpg . '
Return value:...
I'm trying to implement a system call counter, and as a result I included an int value in task_struct, and a function that increments it in a separate file. This function is supposed to be called from system_call right before it actually calls the required sys_call (I have my reasons to call it before and not after). However, if I place ...
We transit from ring3 to ring0 using 'int' or the new 'syscall/sysenter' instruction. Does that mean that the page tables and other stuffs that needs to be modified for the kernel is automatically done by the 'int' instruction or the interrupt handler for the 'int 0x80' will do the required stuff and jump to the respective system call.
...