Programming :: Write The Value To The Proc Entry In The Program?

May 1, 2011

I have a kernel module program which is used to create a entry in the proc file system. I have to read and write values in the entry. Its taken from a online tutorial stuff.how to write the value to the proc entry in the program ?

View 1 Replies


ADVERTISEMENT

Programming :: Check The Presence Of USB Using /proc Interface In A C Program

Feb 22, 2010

I want to check whether a USB is plugged in its slot from a C program. I want to make use of /proc interface for the same. During my reading i found that /proc/bus/usb/devices will tell how many USB devices are currently present.

So whether i can open this file and use stat call to identify whether the size is 0. If size is 0, i can assume no USB present. Else i can assume USB is present.

Whether my understanding correct. If USB inserted, how can i check the folders present in the USB stick.

View 2 Replies View Related

Programming :: Write A Program (in C)?

Feb 26, 2010

I want to write a program (in C), which does 4 or 6 simultaneous calculation. Is there away of doing something like:

do at the same time{
Core 1 do:
this_thing_1

[code]....

View 3 Replies View Related

Programming :: C++ Program Does Not Write File

Jun 26, 2011

I have the following problem. I call a C++ program from a Java servlet by using Runtime exec. The OS is ubuntu and I use Netbeans 7.0 with Glassfish 3.1 web server.The program executes but it does not open and write into a specified file in a specified folder. The same C++ program compiled under Windows opens and writes this file.How can I solve this problem in Linux?

View 2 Replies View Related

Programming :: Write A Program That Interacts With MySql In C

Mar 28, 2011

Im trying to write a program that interacts with MySql in C . Im using slackware 13.1 64 bit and Ive installed MySql , getting help from this page : [URL] .

This is the program I have ( I know they arent any vars here , i just thought it wasnt necessary )

Code:
#include <stdio.h>
#include <mysql/my_global.h>
#include <mysql/my_sys.h>
#include <mysql/mysql.h>

[Code]....

This program is from the MySql website ( a tutorial they have up there ). When I run this program I get hundreds of lines of errors , nothing related to my program , but the headers, indicating that there are syntax errors and all kinds of other problems in them.

View 8 Replies View Related

Programming :: Write A Customized Program For Business?

Dec 13, 2010

My company manufactures satellite TV receiveing equipment. Out current software is quite long and and a bit of an annoyance for customers. I would like the help of a programmer to create for us a customised, easy to use GUI, built to our specification.

View 2 Replies View Related

Programming :: How To Write Simple C Program In RHEL5

Sep 17, 2010

How can i write a simple c program in my RHEL5?I am more concerned about what are toosl i need to install to get a C platfrom running in my RHEL5?

View 14 Replies View Related

Programming :: C - When Write A Program That Gives The Segmentation Fault Error

Jun 9, 2010

I am using Ubuntu 9.04 linux 2.6.28-11-generic. When I write a program that gives the "Segmentation fault" error, or when I send this signal (SIGSEGV) to a program, the "Segmentation fault" is shown and no core dumped. When I look for "core" file in the current directory, I can't find it, too.

View 2 Replies View Related

Programming :: Write A Program In C Which Will Generate A Maze Randomly ?

Oct 8, 2010

I want to write a program in C which will generate a maze randomly and find the solution for it ..

The idea behind is in [url]

How the 16 bit integer is stored in a variable..Earlier I wrote a program on trees and displayed it using dotty.. Is there any such tool to display a maze..I am using ubuntu 10.04.

View 1 Replies View Related

Programming :: Write A Program In C To Detect The Ethernet Cable?

Mar 11, 2009

write a C program to detect whether the Ethernet cable is plugged or unplugged. I found out by using a command "nm-tool" in Linux terminal will show me whether a Ethernet cable is plugged or not. If Ethernet cable is plugged, in the device part of eth0, the Hardware Link of Wired Settings will indicate a "yes" and "no" if no Ethernet cable. Hence, in my previous code, I use one function called popen to read the state as shown below:

PHP Code:

[code]....

However, now my project wish to not use the NetworkManager (where the "nm-tool" command comes from). And this gives me trouble to detect the Ethernet cable. So is there any other method for me to detect the Ethernet cable in C programming?

View 8 Replies View Related

Programming :: Write A Simple Character Printing Program Using NASM?

Jul 27, 2010

i tried a code to accept a character and print the same ! i can accept it with following code but its not working with printing that character i use NASM version 2.07

Code:

segment .data
msg1: db 'Enter a key',10
msg1len: equ $-msg1

[code]....

View 3 Replies View Related

Programming :: Write A Program Which Will Read Input From A Text File

Apr 7, 2010

i am trying to write a program which will read input from a text file, check if each line contains any alphabets and then display a message imforming me if there is an alphabet in each line. My text file is formatted in this way...

[Code]....

View 2 Replies View Related

Programming :: Write A Small Program That Shows Some Stockquotes And Indexes Etc On The Desktop?

Aug 29, 2010

I want to write a small program that shows some stockquotes and indexes etc on the desktop. Does anyone know how to get the quotes from google, yahoo etc? Do I rip it from the webpages or is there some other way?

View 3 Replies View Related

Programming :: Write A Bash Script Program In System Command Terminal?

Mar 22, 2010

I'm trying to write a bash script program in the Linux command terminal that will write to a fellow user and then continue reading down the program. this is what i have (kind of explains the idea too):

#!/bin/sh

clear
echo "this is before the write command"
write jcummins
this message should go to jerry
echo "the message didn't send and this string will not appear"
echo "it appears it has stopped at the write command"

View 5 Replies View Related

Networking :: Record Tx/Rx Bw In A Program - Without Using Tools From /proc/net/

Feb 22, 2011

I need to record Tx/Rx bw in my c program at defined intervals. I am aware that there a bunch of available tools but I need a minimal version with only Tx/Rx bw with no other details. I have tried the tool bwm-ng which mostly serves my purpose but either it runs continuously in the console or saves result in html file. It does not have any options to save the result in txt file which could have been easy to parse.

Is there any other simple way to record Tx/Rx bw in a program?(without using tools from /proc/net/ or any) I am using Mandriva Linux 2.6.31.5.

View 2 Replies View Related

Fedora Installation :: An Error Occurred Mounting Device Proc As /proc: Mount Failed

Jul 6, 2010

I've got the F13 LiveCD that I was able to boot and use using the "nomodeset" boot option. From the desktop I'm trying to perform an Install to Hard Drive. I've read the Install from LiveCD post regarding the creation of a /boot partition and a / root partition. I've tried creating them without the LVM group and with. But every time I appempt to install I get...

An error occurred mounting device proc as /proc: mount failed: (9, None). This is a fatal error and the install cannot continue.

Hardware is a Sager 8887 (P4, 3.06HT, 60GB HDD, Radeon 9000 graphics adapter)

View 7 Replies View Related

Programming :: Write A Program In C That Can Sniff Packets From Ethernet And Distinguish RTP Packets From Non-RTP Packets?

Aug 30, 2010

i need to write a program in c that can sniff packets from Ethernet and distinguish RTP packets from Non-RTP packets, i have no idea what should i do

View 9 Replies View Related

OpenSUSE :: Loat Program Entry In Applications Menu?

Mar 11, 2011

I have openSUSE 11.4 KDE (64-bit). Very inexperienced Linux user. I just dragged Thunderbird's icon to the lower panel so that it can be launched quickly. But now when I go to Application Launcher -> Applications -> Internet -> E-mail, the Thunderbird entry is no longer visible.How do I bring it back?

View 3 Replies View Related

Programming :: Way To Make Proc Filesystem Writable?

Jul 22, 2010

is there a way to make the /proc filesystem writeable? With aufs or unionfs i can't join the /proc filesystem with a writable directory directly. But i think it should work by using one of this file systems.If i try to join two dirs write-proc and virtual-proc Code: mount -v -t aufs -o dirs=/tmp/write-proc/:/tmp/virtual-proc/ none /tmp/joined-proc/ and afterwards make a bind mount /proc to virtual-proc Code: mount --bind /proc /tmp/virtual-proc/ i can't see any change in /tmp/joined-proc.

View 2 Replies View Related

Programming :: C Library Or Some Functions To Read Proc Filesystem

Dec 6, 2010

I have a requirement, to read the complete proc filesystem from the linux pc.. Does linux provide some functions to read the proc filesystem means the directories and files present in the filesystem.. in short I want to create a treeview of proc filesystem. and if a user selects the file in the proc.. I should show the contents in the respective file. So I want some library or functions to read the proc filesystem..

View 1 Replies View Related

Programming :: C Code Fails On Repeatedly Opening /proc?

Jan 16, 2010

I am trying to run my code repeatedly in a loop about 50 times for timing measurement. I have C code running on ubuntu 8 on a single processor, Intel x86. My code is something like this

Code:
for (loop =0;loop<=50;loop++)
{
// other operations
pDir = opendir("/proc");
while (pDir == NULL)

[Code]...

After about 28-29 times the loop stops executing. I initially had a return -1 if I got pDir == NULL. That caused my program to exit, and I dont want that. Any clues on why this happens, and how I can circumvent this?

View 1 Replies View Related

Programming :: Retrieve A Single String Or Value From /proc/cpuinfo

Oct 1, 2010

I'm trying to retrieve a single string or value from /proc/cpuinfo, but when I try to extract the model (not the model name) the model name comes with it, also it likes to print it twice...

Code:
model="`cat /proc/cpuinfo | grep model | cut -d: -f2 | cut -c1-3`"
echo $model

All i want this to do is spit out the model number once. (I need to pass it to another script)

View 14 Replies View Related

Programming :: Read Time Of /proc/net/tcp6 File

Dec 8, 2010

I am trying to read the /proc/net/tcp6 file of a huge server (chat server) for monitoring the tcp6 connection states.

My server's tcp6 file has more than 26000 lines. For monitoring the server connections, my monitoring tool has to read the /proc/net/tcp6 file quickly in a regular interval (5 secs) and process. Presently it takes minimum 6-7 seconds for reading the whole file.

My tool can able to read the normal file (26,000 lines) less than 1 second, but it is not possible to read the same size of proc file.

I have 2 questions:

1) Why proc file takes more read time than normal file?

2) Is there any way to read the /proc/net/tcp6 file more quickly?

View 2 Replies View Related

Software :: Horelease /dev Entry Of Unplugged Storage Device While A Program Has A File Open

Nov 6, 2009

I plug a USB device, it gets a /dev entry, e.g. sdf, i mount its filesystem, then some program opens a file on this filesystem. I unplug this device, its /dev entry disappears, but if i replug this device again, it gets another name - sdg.

How can i force the program to close the file so the filesystem is ready to be unmounted without using "lazy unmount" to release the device name, BUT so that the program doesn't crash after trying to make I/O to this file, and, of course, without having to kill the program?

View 4 Replies View Related

Programming :: Bash - Ps - Psgrep And Read /proc/$pid Make Script Exit

Mar 22, 2011

I have not been able to write bash to use a PID file to ensure no other instance of the same script is running! All three methods I can think of to see if the PID in the PID file is another instance of the script make the script exit with a return code of 1 but the same commands run at the command prompt work as expected.

The first attempt was:

Code:

The first attempted workaround was:

Code:

The second attempted workaround (with debug to make the following command prompt copy and paste meaningful) was:

Code:

Here's the command prompt session, testing with a stale PID file and then manually running the problem command and it behaving as expected:

Code:

This on Slackware64 13.1 which has bash 4.1.7.

In desperation I tried rebooting but the behaviour was the same.

View 2 Replies View Related

Programming :: Get Input From Entry Using Gtk?

May 2, 2011

I'm trying to make a program to simulate a parabolic movement, so i've added 2 entries, one for the initial velocity and other for the angle, anyway you probably don't care about that xD what i want is to take the number entered in the entry and put it in a variable to do the math, and then show everything in a dialog or something. how do i do that?

View 3 Replies View Related

Programming :: Kernel: Which GTD Entry Holds The IDT?

Dec 5, 2010

I have to add a new interrupt framework to the kernel (INT 81h). To add the interface descriptor to INT 81h I have to write to the IDT entry 81h. There are some functions of the kernel that can do this task but they can not be used in a module. So I will now do a patch to the kernel and don't know where to start.

Where is INT 80h interface descriptor written to the IDT? - So I could write it maybe the same way in the same function. Which GTD entry is used to write to the IDT (1, 2, 3 or ...) ? - So I can do some debugging.

View 1 Replies View Related

Programming :: PHP Array - Possible To Get More Than Two Values Per Entry?

Jun 13, 2009

I created a class which has to return an array. My problem is I need to return 3 entries per record for example:

Code:
array(
"2009-06-13", "John", "Doe";
"2009-06-13", "Paul", "Simon";
"2009-06-12", "Frank", "Herbert";
);

Can this be done? What is the syntax? Where is the documentation? If this can't be done, How would you return this to a class without using a DB?

View 3 Replies View Related

Programming :: Python - Placing A Gtk.Entry() Into A Toolbar

Jun 18, 2011

I've searched the web for quite a while and cannot seem to find a way to add a gtk.Entry() to a toolbar via toolbar.insert().

I currently have this:

Code:

Which in turn spits out "Gtk.Toolbar.insert() argument 1 must be gtk.ToolItem, not gtk.Entry"

How would I do this correctly?

View 2 Replies View Related

Programming :: Scaling Of Directory Entry Lookup?

Feb 28, 2011

I need to create and access a very large number of directories (and by large I mean millions). Each directory's name consists only of numbers, which are incremented every time a new directory is created (so there will be directory 1, 2, and so on).Of course I could just dump all these directories under the same parent directory, but I reckon I would run into filesystem limits. Moreover, I presume that entry lookup is not a O(1) operation, which means that lookup does not scale well.

One solution is to use some sort of prefix tree for storing the data. In this scheme, the data for directory "1234" would actually be stored in "/1/2/3/4".This solution has the advantage that each subtree never has more than 10 entries, but the disadvantage of requiring as many individual lookups as the length of the path.There are also intermediate solutions: using a maximum of 100 entries per directory, "1234" would become "/12/34", per example.In order to choose the best scheme, I must know more about the scalability of directory lookup under Linux. What's the maximum reasonable number of entries for a directory before lookup becomes too slow? Does someone know exactly what are the limitations of the algorithm used for directory lookup?

View 1 Replies View Related







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