Sponsored Content
Top Forums UNIX for Advanced & Expert Users How the user process can access the character device loaded by my module Post 302561638 by Corona688 on Tuesday 4th of October 2011 04:52:48 PM
Old 10-04-2011
Code:
int val;
int fd=open("/dev/mydev", O_RDWR);
ioctl(fd, some_ioctl, &val);

If you need more detail than that, I'll need more detail from you. I don't even know what operating system you're on, let alone what your driver's doing...

Last edited by Corona688; 10-04-2011 at 06:00 PM..
 

10 More Discussions You Might Find Interesting

1. UNIX for Advanced & Expert Users

Can kernel process access user address space ?

Can kernel process access user address space ? (2 Replies)
Discussion started by: subhotech
2 Replies

2. UNIX for Dummies Questions & Answers

controll access to a device

Hello everyone, I write a program (Linux & Solaris) that will run as non-root user, but the program must have rw access to a device /dev/ipmi (on linux) or /dev/bmc (on solaris). What is the standard way of granting such access? Linux: chmod on /dev/ipmi ? suid root my program? Solaris:... (1 Reply)
Discussion started by: Pavel.Bures
1 Replies

3. Solaris

mcrypt module is not initially loaded with php

Hi I'm trying to do an upgrade for one application and whenever I run the upgradre the program shows the error that mcrypt module is not initially loaded with php. My server is running xampp 0.9 and I know this library of mcrypt is already installed. I changed the php.ini file in order to... (0 Replies)
Discussion started by: dahr
0 Replies

4. Homework & Coursework Questions

The pseudo-device provides a “backdoor” for gaining root access for a particular user.

Problem statement. In this part of the assignment, delegates will create a pseudo-device and write a device driver for it. The pseudo-device provides a “backdoor” for gaining root access for a particular user. Instead of compiling the device driver into the kernel, delegate will create a module.... (1 Reply)
Discussion started by: nyjilgeorge1
1 Replies

5. SCO

module loaded during the start up

hi Howto find out which driver (module) were loaded during the startup of SCO 5.0.6? (5 Replies)
Discussion started by: ccc
5 Replies

6. Fedora

Is Kernel module is the same as a device driver?

I have been reading prep questions for my second unix academy exam, and there's a nuance, I'm not sure I understand it correctly. I've been under impression from my readings of book by Evi Nemeth and from unix academy DVDs I've been watching, that kernel's modules are drivers. I think of it, as... (25 Replies)
Discussion started by: newlinuxuser1
25 Replies

7. UNIX for Advanced & Expert Users

AIX Dependent Module could not be loaded

I am encountering the above error , even after setting the environment variables correctly AFAIK. I've found sources that say LIBPATH is the shared library variable , and others that say LIB_PATH, so I set both: ========================= root@lipossrp01ga: # echo $gtm_dist ... (6 Replies)
Discussion started by: Clovis_Sangrail
6 Replies

8. UNIX for Advanced & Expert Users

Access a File as a Device?

I backed up my 320GB hard drive to a file with dd: dd if=/dev/sda of=dev_sda.17-Mar-2012 bs=1048576The main idea was to be able to be able to completely replace my hard drive from this backup if necessary, but I'd also like to be able to restore individual files. I realize I could use this dd... (20 Replies)
Discussion started by: Matt Miller
20 Replies

9. Linux

HTTPD process user to access NIS

Hi, I have a machine A with a web server apache2 running. By default, apache2 user is wwwrun. Problem is that this user is local. Instead, I would like apache2 user to be able to login via NIS server so it can access NFS resources of two NIS different groups, let's say group1..groupN... (2 Replies)
Discussion started by: asanchez
2 Replies

10. Shell Programming and Scripting

HTTP::DAV module errors - can't access URL

Hello, I am attempting to use the HTTP/DAV module in perl, and I have a script that transfers files to a website. However, I get the following error message: "Couldn't open https://www.thisismyurl.com/DAV: The URL "https://www.thisismyurl.com/DAV" is not DAV enabled or not accessible." ... (0 Replies)
Discussion started by: Scatterbrain26
0 Replies
FILEMON(4)						   BSD Kernel Interfaces Manual 						FILEMON(4)

NAME
filemon -- the filemon device SYNOPSIS
#include <dev/filemon/filemon.h> DESCRIPTION
The filemon device allows a process to collect file operations data of its children. The device /dev/filemon responds to two ioctl(2) calls. System calls are denoted using the following single letters: 'C' chdir(2) 'D' unlink(2) 'E' exec(2) 'F' fork(2), vfork(2) 'L' link(2), linkat(2), symlink(2), symlinkat(2) 'M' rename(2) 'R' open(2) for read 'S' stat(2) 'W' open(2) for write 'X' _exit(2) Note that 'R' following 'W' records can represent a single open(2) for R/W, or two separate open(2) calls, one for 'R' and one for 'W'. Note that only successful system calls are captured. IOCTLS
User mode programs communicate with the filemon driver through a number of ioctls which are described below. Each takes a single argument. FILEMON_SET_FD Write the internal tracing buffer to the supplied open file descriptor. FILEMON_SET_PID Child process ID to trace. RETURN VALUES
The ioctl() function returns the value 0 if successful; otherwise the value -1 is returned and the global variable errno is set to indicate the error. FILES
/dev/filemon EXAMPLES
#include <sys/types.h> #include <sys/stat.h> #include <sys/wait.h> #include <sys/ioctl.h> #include <dev/filemon/filemon.h> #include <fcntl.h> #include <err.h> #include <unistd.h> static void open_filemon(void) { pid_t child; int fm_fd, fm_log; if ((fm_fd = open("/dev/filemon", O_RDWR | O_CLOEXEC)) == -1) err(1, "open("/dev/filemon", O_RDWR)"); if ((fm_log = open("filemon.out", O_CREAT | O_WRONLY | O_TRUNC | O_CLOEXEC, DEFFILEMODE)) == -1) err(1, "open(filemon.out)"); if (ioctl(fm_fd, FILEMON_SET_FD, &fm_log) == -1) err(1, "Cannot set filemon log file descriptor"); if ((child = fork()) == 0) { child = getpid(); if (ioctl(fm_fd, FILEMON_SET_PID, &child) == -1) err(1, "Cannot set filemon PID"); /* Do something here. */ } else { wait(&child); close(fm_fd); } } Creates a file named filemon.out and configures the filemon device to write the filemon buffer contents to it. SEE ALSO
dtrace(1), ktrace(1), script(1), truss(1), ioctl(2) HISTORY
A filemon device appeared in FreeBSD 9.1. BSD
June 14, 2013 BSD
All times are GMT -4. The time now is 04:14 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy