General :: Define File_operations For Kernel Ioctl Call?

Apr 8, 2010

I have a kernel function device_ioctl(). How do I define it in file_operations?

1. struct file_operations memory_fops = {
ioctl:device_ioctl
};
2. struct file_operations memory_fops = {
.ioctl=device_ioctl
};
3. struct file_operations memory_fops = {
device_ioctl
};

which one is the right one?

View 1 Replies


ADVERTISEMENT

General :: Assign IPV6 Address Using IOCTL System Call?

Jul 22, 2011

Please send me the code how to assign ipv6 address using ioctl system call using C.

View 1 Replies View Related

Programming :: Find The Device Name For Ioctl (sd, SIOCGIFINDEX, &ifr) Call?

Feb 12, 2010

Hi I am trying to add the device by using followig code strip and it says that eth1 is not defind in the code.

strncpy(ifr.ifr_name,eth1,IFNAMSIZ);
if (ioctl(sd, SIOCGIFINDEX, &ifr) == -1) {
return 0;
}

How do I write down the DEVICE name in the ifr.ifr_name structure ?

View 2 Replies View Related

Programming :: Ioctl TIOCMGET Call Doesn't Detect TIOCM_CTS

Apr 6, 2011

I am having the following problem. The following code works fine on my P.C. Ubuntu x64, and on a jetway mini-itx board with an atom processor. The problem is, the same code doesn't work on the intel equivalent of the jetway board. I thought the maybe, I didn't have the port configured right, so I turned on Hardware Flow control and also tried turning on the modem bits I needed with TIOCMBIS. Neither worked. Here is the code. There are two threads, one of them, respsponding to the client, and using the RTS and DTR pins to power two relays. The other, manages listening to CTS and DSR for input. Here is the class with the first thread.

Code:

/*
* DigitalIOCore.cpp
*
* Created on: Nov 1, 2010
* Author: jonathan

[code]....

View 9 Replies View Related

Fedora :: Modify Ioctl TIOCMWAIT To Return The Same Thing That Ioctl TIOCMGET Returns?

Jul 4, 2011

I want to modify ioctl TIOCMWAIT to return the same thing that ioctl TIOCMGET returns. Currently wait returns an int of zero or -1 when a change in status occurs. Why not make it return the new status?

This will make the operation faster by not requiring another call to ioctl.The extra call requires 2 to 16 uSeconds to complete on my x64 laptop. How would I make this proposal to the kernal people?

View 1 Replies View Related

Ubuntu :: Losetup Disk Encryption - Ioctl: LOOP_SET_STATUS: Invalid Argument, Requested Cipher Or Key Length (128 Bits) Not Supported By Kernel

Dec 14, 2010

In 10.04 I was using the following commands to mount an encrypted disk image:

Code: sudo losetup -f Which tells what loop back device block is available Then I'd type:

Code: sudo losetup -e aes /dev/loop0 /home/user/crypt.img and then enter the device's password

Code: sudo mount -t ext4 /dev/loop0 /media/crypt I've tried this in 10.10 and it hasn't been working (I can't remember if I did anything in 10.04 to make it work). I've installed the loop-aes-utils package and restarted my machine. Every time I try the 2nd step, after entering the password I get: Code: ioctl: LOOP_SET_STATUS: Invalid argument, requested cipher or key length (128 bits) not supported by kernel

View 1 Replies View Related

Kernel :: Add A System Call In 2.6.36 Kernel?

Dec 16, 2010

i want to add a new system call.im following this guide [URL] in this step 6 he said add __NR_mycall to some number, in unistd.h. in include/asm/unistd.h there are are around 1079 calls for different hardwares. and the __NR_SYSCALLS is also defined many places. I don't know where to add my new system call. and another qn is. whether the number for syscall in unistd.h and arch/x86/syscall_32.s both should be same?or they can be different.

View 2 Replies View Related

Ubuntu :: Adding A Call System To Kernel?

Apr 21, 2010

My ubuntu version is 9.10

I was working on adding a call system to my linux kernel.

I tried a lot of threads and .pdf files which explaining how to add a system call. Like :

1- This thread
2- .pdf file

and many ..

I tried working with linux-2.6.18.1 , 2.6.33.1 , 2.6.28.1 and many many.

But , all of them are returning -1 as result ..

I prefer working on 2.6.28 kernel version or above like 2.6.33.1

View 1 Replies View Related

Programming :: Test New System Call Before Compiling Kernel?

Apr 2, 2009

I want to test my system call that be goint to add to kernel, But when i finish compiling kernel, i found my system call code not work. the code i want to return the system time "struct timespec":

/*----------Start of mycall.c----------*/
#include <linux/linkage.h>
#include <linux/time.h>
#include <linux/kernel.h>

[code]....

so i want a method to test the new system call before compiling kernel.

View 2 Replies View Related

Programming :: Simple Example Document For Adding A System Call On Fedora 14 Kernel?

Nov 20, 2010

Does anyone have straightforward simple example document for adding a system call on fedora 14 kernel?

View 12 Replies View Related

Software :: Script That Call A Java Program That Call A System Command?

Nov 29, 2010

In practice I have a script that call a java program that call a linux system command. The script if I run it, from a shell functions well,so it is not a java problem. The problem come out when i put this script in a crontab schedulation. The result in this case is that java do not execute the system command. I think it depends on crontab

View 4 Replies View Related

General :: Define TAB Key At Terminal?

Jul 7, 2010

I want to define TAB key at terminal.When i press TAB key i want all files shows like "ls -ltrh -color"

View 12 Replies View Related

General :: Define A Proxy In VNC Client?

Feb 8, 2010

'm trying to access remotely to my computer that is in my home with a VNC client. The problem is that from my company site, I'm behind a proxy and I must use this proxy to connect my computer.I'm new to the vnc programs, so I don't know how to define a connection to use the proxy. My laptop is well configured, the only problem is set a vnc client to use a defined proxy. 1 - I've installed VNC viewer or tightvnc viewer, but I can't find any option in it to define a proxy. How can I define a proxy in this program?2 - Is there any vnc client that allows to define a proxy?3 - Should I define a tunnel that redirects my connection to my remote PC? For example, if I define a tunnels that from localhost:5656 it connects to my remotePCort through the proxy will I hane any problem

View 1 Replies View Related

General :: Define Ctrl-[ As A Shortcut In Emacs?

Aug 9, 2010

On Linux, the Ctrl-[ key combination appears to be equivalent to hitting the Esc key. I would like to define Ctrl-[ as a shortcut in emacs but I am unable to because by the time the keystroke gets to emacs it looks like the Esc key was pressed. Is there anyway to disable this behavior so that Ctrl-[ simply means Ctrl-[?

View 2 Replies View Related

General :: How To Define File Type For Wget

Jan 25, 2011

how can I define file type for wget to download . for example I do not want to download *.html or I just want to download *.jpg files . or if it does not support any of them do you know any other suggestion ?

View 1 Replies View Related

General :: Define Root For A Hard Disk?

Feb 8, 2010

When installing Linux,sometimes i tried to install that on my second hard disk, which is set to be a dynamic disk(named hdb),but a message said that: root is not defined for hdb.
-What does that mean? Does it mean that a Linux driver must be opened on that hard disk? if so:where do i find a linux driver

View 3 Replies View Related

General :: Add A Rule In User Define Chain?

Nov 30, 2010

I have created a new user define chain # iptanles -N blacklistNormally when we add a new rule it automatically insert in the default iptable but when we create a user define chain then how can I add my rules in this chain ?

View 3 Replies View Related

General :: Define A String Of Repeated Characters?

Feb 5, 2011

this seems like it should be a simple thing, but I can't find it. Is there a bash shell command that allows you to create a string of repeated characters? Like a string of 100 '*'?

View 6 Replies View Related

General :: Define A Hebrew/Latin Layout + Compose Key In Mageia 2?

Aug 23, 2011

I'm on Mageia Linux Cauldron (what will become Mageia 2), where Mageia Linux is a recent community fork of Mandriva Linux. this script gives me the Xkb layout that I need:

#!/bin/sh
setxkbmap
-option ""
-option "compose:ralt,grp:switch,grp:alt_shift_toggle,grp_led:scroll"
-variant ",lyx"
'us,il'

[Code]...

View 1 Replies View Related

General :: Define Both Source/Destination AND Direction When Building Firewall?

May 30, 2011

why do we have to define both Source/Destination AND Direction when building firewall.Isn't direction= source->destination? what would happen if source and destination were swapped?

View 3 Replies View Related

Programming :: Call Socket Prog Code Written In User Space From Kernel Space?

Jul 14, 2009

How to use execv from kernel space to call a user space program writtenfor socket prog.

I tried to write code for socket in kernel but its not working.

Socket code in kernel is also needed.

View 2 Replies View Related

General :: Define A Keyboard Layout / Input Method For Ubuntu In Python?

Jun 20, 2010

defining keyboard layouts in linux (ubuntu 10.04 here). there does not seem to be any easy, graphical way to define keyboard mappings (except for keyboardlayouteditor, but frankly, i do not understand the installation description.i am using an apple aluminum keyboard with a german layout, but no matter what i do the (<>) and (^°) keys are always swapped (i did manage to change the default behavior for the f1...f12 keys from multimedia back to 'ordinary', application-centric... all you have to do is add the line echo 2 > /sys/module/hid_apple/parameters/fnmode to /etc/rc.local... this is so bloody obvious i am ashamed i had to search the web for this!).

adding to my distress, i find the chinese IMEs a horror (not a single one of the many i tried does anywhere come near google pinyin for windows), and have gotten neither ibus nor scime to work in a satisfactory way for me. i find linux keyboard handling a morass. i know this must be one of the hardest problems in computer science, since this subject gets so convoluted no matter whether its on windows or in-the-browser javascript. as a linguist i am well aware of the inherent complications proper text handling poses, but looking at descriptions how to configure xkb makes building interstellar spaceships look like a cakewalk.

find a place in the system where keystrokes are recorded;read out those codes (could be scan codes or character codes) using a daemon (implemented in python; i heard you have to listen to IOCTL or somesuch); when certain code combinations appear, switch them to do what you want;applications now get to see a X where formerly the got to see a U and vice versa;profit!

Is there a place, in ubuntu / linux systems that does allow reading out keyboard codes? Is there a way to block processing of such keyboard actions until an intercepting daemon has processed them? Would such an interceptor work for a broad range of use cases? like on the command line, in a gtk app, in wine, in firefox and so on? An alternative would actually be to grok keyboardlayouteditor, so if someone could post about a readable, complete installation instruction or point out installable packages, that'd be great, too.

View 1 Replies View Related

Hardware :: How To Spin-up HDD Using Ioctl

May 8, 2010

I have used the following code for HDD spindown.

Quote:

{
#ifndef WIN_STANDBYNOW1
#define WIN_STANDBYNOW1 0xE0
#endif

[code]....

Is ther any ioctl command to do HDD spin-up from spin-down? or Is there any way to HDD spin-up?

View 2 Replies View Related

Networking :: Unable To Get IPv6 Addresses Using Ioctl()

Feb 4, 2011

I am able to retrieve IPv4 addresses with ioctl. But it is not returning IPv6 addresses. My requirement is to get both IPv4 and IPv6 addresses. I can not use getifaddrs() since it has to be common code between linux, solaris and aix. Solaris and AIX are not having getifaddrs(). Following code is returning only IPv4 addresses.

Code:
#include <sys/types.h>
#include <sys/socket.h>
#include <sys/ioctl.h>
#include <netdb.h>

[Code]....

View 1 Replies View Related

Software :: Ioctl - ATM_SETBACKEND - No Such Device - Speedtouch 330

May 24, 2010

I have a problem with USB modem SpeedTouch 330 in SUSE

When I execute:

Code:

I see this:

Code:

I have checked command 'lsmod' and it returns

Code:

In general I see speedtch is several times in the output of lsmod

When I check this:

Code:

I see

Code:

Why I cannot establish a connection to the internet?

View 1 Replies View Related

Programming :: IOCTL Error - To Get The Ssid Through C Program

Feb 28, 2011

I was trying to get the ssid of WLAN through the following C program

What is the cause of this error?

View 1 Replies View Related

Programming :: Return Error From Ioctl Command?

Jul 21, 2010

I'm creating a usb device driver that needs to be able to read from two different endpoints. I couldn't see any way of having two read functions in the driver, so I got round this by reading from one of the endpoints with read, and the other with ioctl.However this hasn't worked, the ioctl call from c returns -1. I added a printk command in the driver in the ioctl function, however looking at kern.log I can see that this function is never being called. Does anyone have any ideas as to what the problem called be, or a better method of being able to read from two different endpoints?

View 2 Replies View Related

Programming :: Writing And Reading Driver Value In Ioctl?

Jan 18, 2011

I just want to read and write some values (integer) to my driver. I used put/get user but always getting errors.

driver

Quote:

int Wert;
static int device_ioctl(struct inode *inode, struct file *file, unsigned int cmd, unsinged long arg)
int ret;

[code]...

Quote:

int WERT
ret=ioctl(fd, SETIT, WERT)
ret=ioctl(fd, GETIT, WERT)

if i say in C++ WERT is 5 the value arg of the driver becomes 5 but not WERT the returnvalue of get and put user is -1 so it failed.

View 12 Replies View Related

Networking :: Hget IPv6 Address Using Ioctl() SIOCGIFADDR

May 19, 2010

I have retrieved IPv4 address successfully using

Code:
struct ifreq ifr;
fd = socket(AF_INET, SOCK_DGRAM, 0);
ifr.ifr_addr.sa_family = AF_INET;
ioctl(fd, SIOCGIFADDR, &ifr)
for IPv6 address I tried

[Code]....

View 5 Replies View Related

General :: How To Call Other File

Apr 10, 2011

i want to know how to call the other file in linux. example i got this code that store into example1.sh and i want to store the data into other file like example2.

View 2 Replies View Related







Copyrights 2005-15 www.BigResource.com, All rights reserved