Question about a /proc/pid/ctl read

Hi,
I'm trying to read some bytes from /proc/pid/ctl using PCREAD command, I attached a priovec_t struct like this:
     priovec_t strc;
     char buffer[100] = {0};
     strc.pio_offset = atoi(argv[2]);
     strc.pio_len = 100;
     strc.pio_base = buffer;
     long ctrl[2];
     ctrl[0] = PCREAD;
     ctrl[1] = (long)&strc;
     if(write(ctl_fd, ctrl, 2 * sizeof(long)) == -1)
          perror("Read ctl error.");
          close(ctl_fd);
          exit(-1);
but it does not work, so I think the way I pass the perameters may be wrong. I'v search everywhere to get a sample code using /proc file system, but found nothing. Can anybody give some suggestion?
By the way, where can I find examples indicating how to use the large amount of procfs files!!
Thanks a lot!

What is the best source to access /proc file system code snippet. I am interested in calculating %cpu utilization of a running process, just like ps command.
Any pointer/help is appreciated.
thanks

Similar Messages

  • Question about c++/proc

    Hello,
    I want to (learn basically) try proc and I am writting some simple trivial program.
    Do I need to have actual database running to compile the program ?
    I mean, can I just compile the program without having database available (at compile time) ?
    ( reason is that database is not on my laptop and I need to do vpn etc to connect .... and somehow I think that I should be able to compile it just like other c program ---- please correct me . BTW, I don't have much knowledge about oracle DB/tools ... just starting. I am good with C/c++ )
    Regards,
    Digambar

    If I understood your requirement correct then I think you are trying to compile the Pro*C/C++ application. To compile and link Pro*C applications we need Oracle client to be installed. For some of the Precompiler parse related option Pro*C need to connect to server, however that may not be matter here.
    To answer your question, Yes, you can compile the Pro*C without having DB/Server installation!!

  • Question about using JavaMail API to read the calendar folder...

    Hi,
    I've made an application that goes to the mail server, fetches all mails in the calendar folder and tells you the meetings you have in a particular day.
    I'm using JavaMail API for this. My problem is that the application is very slow because I'm forced to fetch (one by one!) the contents of every message.
    My question is: How can Outlook show so fast the mettings you have? Do they have a specific API that allows them to get the right info by only calling certain methods? Is there something similar in Java?
    Thaks for your help!
    Note: I use method:
    folder.fetch(allMessages, fetchProfile);howerver the fetchProfile class does not allow me to specfy that I want to dowload the contents of the message (you only can specify the content_info); specifying all headears does not help me either.

    Clarification:
    The VI you have posted will work as following:
    1) The task will read 2 analog inputs (ai0, ai3).
    2) The acquisition starts, oncece digital signal (trigger) is detected on PFI0
    3) The sampling rate will be as specified in "rate" control - it is continuous analog input acquisition, which means that after trigger is received (point 2), the board will start to generate hardware clock with frequency you specify as "rate"
    4) with each rising edge of that hardware clock, the measurement is taken, and stored into buffer of driver.
    5) DAQmx read will try to read "number of samples per channel" number of samples each time is called - and if there is not enough measurement stored in buffer (step 4), then DAQmx read will wait until DAQ card will measure reaquested number of samples (or timeout occurs before requested number of samples has been acquired)
    6) DAQmx read will be then called 1000 times - so totaly you will read 1000 * "number of samples per channel"  number of samples.
    You do not have to be worried about speed of the loop. In fact, if you need to read just 1000 samples, with 1kS/s, then you can remove for loop and you can change measurement mode from continuous to finite samples, and specify number of samples to read to be 1000. You will read them all properly. I recomend you to read User Manual for your DAQ device - lets say M Series User Manual.
    I hope it is clear now.
    regards,
    stefo

  • Question about entry point in adobe reader

    I click on a website link and the computer won't open it.  The paragraph that comes up says "Entry Point not found.  The procedure entry point JS_SetCheckObjectAccess callback could not be located in the dynamic link library js 3250.dll."  What does this mean and how can I get rid of it so I can access the link.  When I first installed Adobe Reader it worked fine, but this problem has been occurring for about 2 weeks or so.  Thank you for your help!!

    That isn't a problem of Adobe Reader. It is a Firefox problem:
    http://support.mozilla.com/eu/forum/1/398339

  • Question about making printible reports by reading data from database

    We have a pressure test system which we want analyze and plot the instant pressure values in a pre-defined time interval. After each test we want the record the test results along with the other information(date, time, operator name, test no, product type, product number, etc.) added by the system operator. The data will be recorded to an access data base. Doing that, we want to make test results archive which we can make search within, to list the past test results, searching by date, seraching by product number, or searching by any other information in the database. Plus, in the future, we want to be able to take reports of these past test results, including the pressure/time graph and other information added by the system operator. Also we want to set the report format.
    My question is, is it possible to do this with LABVIEW 8.2? Do we need any toolkits or add-ons?
    Regards

    Hi, Hasan.
    That would be an excellent use of LabVIEW. At the very least, you'll probably want to get the Database Connectivity Toolkit, and depending on your needs you may also want the Report Generation Toolkit. There are a lot of tools in the LabVIEW Development Environment for generating reports dynamically, but the Report Generation Toolkit includes a lot of advanced functionality not included in regular LabVIEW installations.
    That said, however, I really recommend you speak with one of our sales representatives to make sure you have everything you need. Since I know so little about how you'd be implementing each step of that process, I'm reluctant to guarantee it, and one of our representatives can tell you with much more certainty. You can get in touch with one from ni.com/contact.
    Good luck! Have a nice evening.
    Sarah K.
    Search PME
    National Instruments

  • Question about error message in Adobe Reader

    I reinstalled Reader and now when I try to open a program I get the error message Acrobat Failed to load its Core DLL

    Hi
    Please follow this KB doc: http://helpx.adobe.com/acrobat/kb/reader-core-dll-error.html
    Thanks

  • Few questions about iPhone 4S

    Hi,
    Recently I got an iPhone 4S, it is my first new phone in a long time, before this I had an old nokia, so I just have a few questions about it.
    I havve read a alot of horror stories about the 4S battery life, mine seems ok, here is what I would like to know
    1) How long should a healthy battery last?
    2) how long should it take to charge to 100% from 1 or 2%?
    On my daily commute I use listen it to music and sometimes user twiiter/facebook. I also get alerted of emails when they come in. So far it has just about lasted just about two days maybe before I had to recharge. Is this about right? As stated above I am coming from an old nokia, which is very dated now but the battery lasted almost a week before I had to charge, so having to charge my phone this often is new to me. My iPhone is really great and I just don't want any problems. I have turned off all extras that I don't need.
    BTW are the iPhone 4S battery issues a software or hardware issue?
    Thanks

    I attempted to read your post, but in amongst all the random, unrelated waffling, I couldn't actually find exactly what your iPhone related question for this "Using iPhone" forum was.
    Would you like to clarify? Concisely.

  • I have a question about Lightroom 5... I used it last night, I go to get on it today and its will not open. I have an error msg "Lightroom encountered an error when reading from its preview cache and needs to quit" Lightroom will attempt to fix the proble

    I have a question about Lightroom 5... I used it last night, I go to get on it today and its will not open. I have an error msg "Lightroom encountered an error when reading from its preview cache and needs to quit" Lightroom will attempt to fix the problem when reopened

    https://forums.adobe.com/message/6219922#6219922
    See if the issue in the thread above helps you to solve your problem.

  • I have a Macbook Pro june 2011... I have 8GB ram but I only have 256mb VRAM... I've read some other questions about this and I realized... Why do I not have 560mb of VRAM since I have 8GB of RAM? Is there any way to get more VRAM to play games on steam?

    I have a Macbook Pro june 2011... I have 8GB ram but I only have 256mb VRAM...
    I've read some other questions about this and I realized... Why do I not have 560mb of VRAM since I have 8GB of RAM?
    Is there any way to get more VRAM to play games on steam?
    I've learned  by reading other topics that I can't upgrade my graphics card on my Macbook Pro because it's soldered into the motherboard or somthing like that, but please tell me if there is any way to get more video ram by chaning some setting or upgrading something else. I'd also like to know why I only have 256MB of VRAM when I have 8GB of RAM, since I have 8GB of RAM I thought I was supposed to have 560mb of VRAM...
    So the two questions are...
    Is there any way to upgrade my VRAM, so that I can play games on steam?
    Why do I only have 256MB VRAM when I have 8GB total RAM?
    Other Info:
    I have a quad core i7 Processor.
    My graphcics card is the AMD Radeon HD 6490M.
    I am also trying to play games on my BOOTCAMPed side of my mac, or my Windows 7 Professional side.
    THANK YOU SO MUCH IF YOU CAN REPLY,
    Dylan

    The only two items that a user can change on a MBP are the RAM and HDD (Retinas not included).  You have what the unit came with and the only way you will be able to change that is to purchase a MBP with superior graphics
    If you are very much into gaming, the I suggest A PC.  They are far superior for that type of application to a MBP.
    Ciao.

  • Question from worse than Newbie about digital signatures and Adobe Reader.

    1st, thanks for taking the time to even look. 2nd, We are trying to use digital signature pads with PDF documents created by Documaker 11.4. In Adobe Pro there is a setting "Extend features in Adobe Reader" that will allow users with Adobe Reader to sign the PDF documents, however our "guy" creating the forms cannot find anything like this in Documaker. I've never used Documaker before and dont have a copy to even play with, but I was hoping there was a simple "go here, click this" answer.
    Any and all help is greatly appreciated.
    Thanks for you time,
    Jeff Holt

    I'm not expert on Documaker, but I'm close to them and will try to find an answer if I can be sure of the question.
    Documaker is capable of creating PDF signature markers in the output PDF. Those markers are compatible with tools like Acrobat which can sign the documents. Is your question about how to create the markers or are you doing that and finding that Acrobat Reader will not allow you to sign them?
    I'd have to research Adobe's licensing for Acrobat and Reader to see if that was the issue. I know certain features in Acrobat Reader are locked down by Adobe so you have to have another product license from them to enable the feature. If that is the problem, then I'm pretty sure that Documaker has no mechanism to provide a license token to specifically enable the Acrobat Reader product.
    If you can provide more specifics, I'll try to follow up. You may also contact Customer Support, if you haven't already and open a case there requesting a specific question be answered.
    Best Regards.

  • Hello , I want to ask some question about ipads \  How powerful is the iPad?  How useful is it for reading books, newspaper or magazines or for surfing the web? Can you identify any shortcomings of the device?   please help me :(

    Hello ,
    I want to ask some question about ipads \
    How powerful is the iPad? 
    How useful is it for reading books, newspaper or magazines or for surfing the web?
    Can you identify any shortcomings of the device?  
    please help me

    it's less powerful than your average computer. THink of it like a netbook but with a better processor.
    It'll do fine for surfing (although if you browse a lot of flash based sites you will need to get a third party browser since safari doesn't accommodate it)
    You may do OK on reading books, papers or magazines, especially if they have apps, but the ipad's screen is backlit, so it doesn't work well outdoors and you may need to fiddle with the brightness so that you don't get eye strain (it's just like doing too much reading from a computer screen)
    I would say the biggest short comings are data transfer. Apple's preferred work flow is that everything is done via iTunes or the internet....well people dont' always have 100% reliable always on internet access so you can find yourself in a situation where you can't get things on/off the iPad.
    By and large, it's a good device for day to day stuff, but is not a computer replacement.

  • Image enduser workstation: question about ACF and Adobe Reader component

    Our IT department is investigating what components should be included in the image for enduser workstations to ensure they will be able to work with interactive forms without any problem. I know ACF and Adobe Reader are the only requirements for endusers but I have some questions about this:
    1. As of what version of Netweaver 2004s is it no longer a requirement to have the ACF component installed on the frontend to enable online interactive scenario's for endusers?
    2. Can I recommend to allways install the very latest Adobe Reader version available in the market or is the Adobe Reader version depending on the SAP NetWeaver version we use?
    kind regards
    Angelique Heutinck
    ([email protected])

    Hi Angelique,
    The non ACF version is called Zero Client Installation (ZCI)
    ERP2005 SP 5 - Zero Client Installation (ZCI)
    NW04S Stack 08
    Reader 8.0 for ZCI, Reader 7.08 for ACF based forms. Don't use Reader 8 for ACF yet, since there is no installer working yet...
    Cheers,
    Noë

  • Question about Reader DRM activation

    Hi All
    I got a paper "FAQ ACS Discontinuation of Sales, November 30, 2004"
    I have a question about ACS.
    As I konw, ACS is discontinued effective November 30, 2004.
    and I read a section in paper below:
    Q. Will Adobe Reader and Acrobat users get support from Adobe for eBook issues?
    A. Support is not available for the free Adobe Reader, however, assistance for user activation is
    available until December 31, 2006.
    Does it mean Reader activation service will be stop until December 31, 2006?
    That's a big problem for our ebook service!!

    Adobe communicated in January to ACS customers that the DRM Activator service would remain operational until December 31, 2007, one year longer than previously announced.
    If you didn't receive this announcement, send your contact info (email and surface mail) to "[email protected]".
    You'll receive an autotmated reply that your email bounced but it will then be manually confirmed.

  • A question about creating READ ONLY users.

    Dear all,
    I have a question about read only user accounts and I would appreciate if you could kindly give me a hand. I have a schema named SCHEMA1. Whenever I want to connect by using sqlplus I run the following:
    sqlplus user1/[email protected] SCHEMA1.WORLD is the entry in the tnsnames.ora referring to the schema SCHEMA1.
    I need to create a read only user who is able to SELECT all tables and views created by user1 on SCHEMA1 (this user will not modifiy anything at all. The user is used only for a person using SQL queries to read data). for several tables I write the grants explicitly, for example:
    CREATE USER user2 IDENTIFIED BY user2;
    GRANT CREATE SESSION to user2;
    GRANT SELECT ON S001_COR_ECLASS TO user2;
    GRANT SELECT ON REF_ECLASS511 TO user2;Is there anyway to do the same thing but for all the tables (because there are a lot of tables and views)? Besides, even with these granted permissions when the user connects with SQL Developer to the database, he is not able to view the list of tables/views in SQL Developer GUI. What causes this problem?
    Thanks in advance,
    Dariyoosh

    Hello Dariyoosh,
    he is not able to view the list of tables/views in SQL Developer GUIyou can either go to "Other Users" - user1 - tables. There you see every table you have permission to select.
    Or you can create a synonym in schema2 for each table in schema1 and set a filter on the tables node of user2 "Include synonyms".
    Regards
    Marcus

  • Question about 360 movieclip with cursor action

    Hello Flash Forum
    We have a question about a 360 flash / movieclip which comes
    to a halt or jumps to whereever the cursor is moved horizontally
    while any vertical movements is ignored. We are having difficulties
    to implement this and would like to ask whether someone can point
    us into the right direction in Flash 8 - read somewhere that this
    is extremely easy in Flash 8 but we cannot find out how!?
    An example would be:
    http://www.kswiss.com/cgi-bin/kswiss/store/product_detail.html?mv_arg=x&pid=01190:177
    and then chosing 'Go 360'
    Thank you for any assistance and/or direction.
    Alex

    Alex, took a look at your sample - looks to me like
    start_drag and stop_drag on mouse_over. Hope this helps. ash

Maybe you are looking for

  • Illustrator crashed

    Hello! I have Creative Cloud 2014 MacOS When the program starts, illustrator crashes and generates an error. Please help! Process:               Adobe Illustrator [2957] Path:                  /Applications/Adobe Illustrator CC 2014/Adobe Illustrator

  • Big Picture Questions on Aperture usage

    Hi! My company manufactures a product that our customers are nutso about. We encourage them to take photos of themselves, and send the photos to us. We then publish them on our web site. As a result, I receive sometimes a couple of hundred photos a m

  • How can I send a PDF via mail without it becoming an attached file?

    Hi All! I need to know how I am able to send a PDF file via mail, without it becoming an attached file. This means when the receiver opens the mail, he automatically sees the PDF without first having to read the normal mail text and scroll down to op

  • Cisco WLC 5508 HA AP-SSO not possible

    Hi! A custommer of mine tried to configure HA AP-SSO with two 5508 controllers. After rebooting the primary controller changed into Maintanence Mode. Version 7.3.101.0 (Cisco Controller) >show redundancy summary Redundancy Mode = SSO ENABLED Local St

  • Firefox lately always opens a new window

    Whenever I click a link in firefox, whether I option-click it or right-click it and choose "Open in new Tab." Firefox lately always opens a new window, not a tab. For the life of me, I cannot get it to open a page in a new tab. There was a time when