How can I use system call in kernel loadable module?

Hi,
I want to use system call (shmat, mmap,...) in kernel module.
When kernel module is loaded, it cause system error (undefined symbol name 'shmat', 'mmap').
How can I use system call in kernel module ?
Thanks in advance.
david joo

You cannot use system calls in the kernel modules.
Read 'Writing Device Drivers' answerbook - it lists the set of interfaces (known as DDI/DDK) that are supposed to be used instead.
Hope this helps...
--I.

Similar Messages

  • How can i use talking caller id without jailbreak and those wacky apps

    how can i use talking caller id without jailbreak and those wacky apps

    Talking caller ID is not a feature of the iPhone. If by "wacky apps" you mean the ones that make custom ring tones for each contact from their name, that's your best bet.

  • How can i use video call

    Syed Shahzad

    Hi and welcome to the Skype Community,
    Please take a look at the instructions here on how to perform a video call using Skype for Windows Phone: https://support.skype.com/en/faq/FA12181/making-a-video-call-windows-phone-8
    Follow the latest Skype Community News
    ↓ Did my reply answer your question? Accept it as a solution to help others, Thanks. ↓

  • How can I use the call's list?

    Dear friends,
    I have some problems with a call I received and with my boss.
    On my Iphone 4S I can see the list of the last calls. Let's say that I have a 45minutes incoming call from my friend. Looking the detail by the arrow, on the right, I can see also other information, like the complete number and the lenght of the call (45 min, in this case).
    Now the point: someone heard me during the call and said I got that phone call form someone else!
    I replied that is not possible: you can modify the name of the contact, in this case it seems that I got the call from the new name, but I also showed that if you modify the number too (yes, it's possible) the call disappears from the call list!
    Now I have the complete call list and I can show that the "trick" is not possible, but they don't believe me and, since the question is quite important, I'm risking to loose my job.
    Can someone give me the confirmation that is not possible to do this? I mean, I want to be sure of my theory that no one can change name and number of the call and keep the call amongst all the other calls...
    Many thanks in advance for your help!
    Mark

    You cannot use your iPhone as a normal storage system. The only way to get documents and other stuff on it is to sync via iTunes (unless you use an app like evernote, which has its own sync).

  • How can I use phone call sharing on my iPhone 4S?

    I have an iPhone 4S running on the latest version of iOS (8.1) and a Macbook Pro Retina (Late 2013) running latest version of OS X Yosemite (10.10 (14A389)). This phone does not have FaceTime as it was purchased in the UAE and it is apparently one of the countries that blocks access to FaceTime, so I cannot use FaceTime to " turn on “iPhone Cellular Calls" in preferences. I have tried all other methods mentioned in this article: Get help using Continuity with iOS 8 and OS X Yosemite - Apple Support

    Pravine wrote:
    "A really bad idea, unless you like malware and the possibility of bricking your phone."
    Jailbreaking is not done to attract malware and possibility and in most cases it is not the case. You are supposedly assuming that jailbreaking is done as jailbreakers "like malware". Your statement is wrong as in essence, jailbreaking your iPhone means freeing it from the limitations imposed on it by your carrier, whether that's AT&T or Verizon, and Apple. It lets you do everything from customizing the look of your iPhone to installing third-party applications (such as titles that are not authorized and available in the App Store) and customized ringtones on it. Depending on how far you're willing to go, you can do even more than that: Jailbreaking even lets you to unlock your phone so you can use it with a carrier other than the one from which you purchased it and in my case you can enable continuity.
    The statement was in the spirit of irony. And no, I do not assume users jailbreak because they actually want malware. However, jailbreaking does indeed make the device far more susceptible to such, and it also occurs far more than you seem to think.

  • SOLVED: How can I use or call a function that returns %ROWTYPE?

    Hi
    edit: you can probably skip all this guff and go straight to the bottom...In the end this is probably just a question of how to use a function that returns a %rowtype.  Thanks.
    Currently reading Feuerstein's tome, 5th ed. I've downloaded and run the file genaa.sp, which is a code generator. Specifically, you feed it a table name and it generates code (package header and package body) that will create a cache of the specified table's contents.
    So, I ran:
    HR@XE> @"C:\Documents and Settings\Jason\My Documents\Work\SQL\OPP5.WEB.CODE\OPP5.WEB.CODE\genaa.sp"
    749  /
    Procedure created.
    HR@XE> exec genaa('EMPLOYEES');which generated a nice bunch of code, viz:
    create or replace package EMPLOYEES_cache is
        function onerow ( EMPLOYEE_ID_in IN HR.EMPLOYEES.EMPLOYEE_ID%TYPE) return HR.EMPLOYEES%ROWTYPE;
        function onerow_by_EMP_EMAIL_UK (EMAIL_in IN HR.EMPLOYEES.EMAIL%TYPE) return HR.EMPLOYEES%ROWTYPE;
        procedure test;
    end EMPLOYEES_cache;
    create or replace package body EMPLOYEES_cache is
        TYPE EMPLOYEES_aat IS TABLE OF HR.EMPLOYEES%ROWTYPE INDEX BY PLS_INTEGER;
        EMP_EMP_ID_PK_aa EMPLOYEES_aat;
        TYPE EMP_EMAIL_UK_aat IS TABLE OF HR.EMPLOYEES.EMPLOYEE_ID%TYPE INDEX BY HR.EMPLOYEES.EMAIL%TYPE;
        EMP_EMAIL_UK_aa EMP_EMAIL_UK_aat;
        function onerow ( EMPLOYEE_ID_in IN HR.EMPLOYEES.EMPLOYEE_ID%TYPE)
            return HR.EMPLOYEES%ROWTYPE is
            begin
                return EMP_EMP_ID_PK_aa (EMPLOYEE_ID_in);
            end;
        function onerow_by_EMP_EMAIL_UK (EMAIL_in IN HR.EMPLOYEES.EMAIL%TYPE)
            return HR.EMPLOYEES%ROWTYPE is
            begin
                return EMP_EMP_ID_PK_aa (EMP_EMAIL_UK_aa (EMAIL_in));
            end;
        procedure load_arrays is
            begin
                FOR rec IN (SELECT * FROM HR.EMPLOYEES)
                LOOP
                    EMP_EMP_ID_PK_aa(rec.EMPLOYEE_ID) := rec;
                    EMP_EMAIL_UK_aa(rec.EMAIL) := rec.EMPLOYEE_ID;
                end loop;
            END load_arrays;
        procedure test is
            pky_rec HR.EMPLOYEES%ROWTYPE;
            EMP_EMAIL_UK_aa_rec HR.EMPLOYEES%ROWTYPE;
            begin
                for rec in (select * from HR.EMPLOYEES) loop
                    pky_rec := onerow (rec.EMPLOYEE_ID);
                    EMP_EMAIL_UK_aa_rec := onerow_by_EMP_EMAIL_UK (rec.EMAIL);
                    if rec.EMPLOYEE_ID = EMP_EMAIL_UK_aa_rec.EMPLOYEE_ID then
                        dbms_output.put_line ('EMP_EMAIL_UK  lookup OK');
                    else
                        dbms_output.put_line ('EMP_EMAIL_UK  lookup NOT OK');
                    end if;
                end loop;
            end test;
        BEGIN
            load_arrays;
        end EMPLOYEES_cache;
    /which I have run successfully:
    HR@XE> @"C:\Documents and Settings\Jason\My Documents\Work\SQL\EMPLOYEES_CACHE.sql"
    Package created.
    Package body created.I am now trying to use the functionality within the package.
    I have figured out that the section
        BEGIN
            load_arrays;
        end EMPLOYEES_cache;
    /is the initialization section, and my understanding is that this is supposed to run when any of the package variables or functions are referenced. Is that correct?
    With that in mind, I'm trying to call the onerow() function, but it's not working:
    HR@XE> select onerow(100) from dual;
    select onerow(100) from dual
    ERROR at line 1:
    ORA-00904: "ONEROW": invalid identifier
    HR@XE> select employees_cache.onerow(100) from dual;
    select employees_cache.onerow(100) from dual
    ERROR at line 1:
    ORA-06553: PLS-801: internal error [55018]
    HR@XE> select table(employees_cache.onerow(100)) from dual;
    select table(employees_cache.onerow(100)) from dual
    ERROR at line 1:
    ORA-00936: missing expressionHe provides the code genaa.sp, and a very brief description of what it does, but doesn't tell us how to run the generated code!
    Now, I have just done some googling, and it seems that what I am trying to do isn't possible. Apparently %ROWTYPE is PL/SQL, and not understood by SQL, so you can't call onerow() from sql. Correct?
    So I try wrapping the call in an exec:
    HR@XE> exec select employees_cache.onerow(100) from dual;
    BEGIN select employees_cache.onerow(100) from dual; END;
    ERROR at line 1:
    ORA-06550: line 1, column 30:
    PLS-00382: expression is of wrong type
    ORA-06550: line 1, column 7:
    PLS-00428: an INTO clause is expected in this SELECT statement
    HR@XE> exec select table(employees_cache.onerow(100)) from dual;
    BEGIN select table(employees_cache.onerow(100)) from dual; END;
    ERROR at line 1:
    ORA-06550: line 1, column 14:
    PL/SQL: ORA-00936: missing expression
    ORA-06550: line 1, column 7:
    PL/SQL: SQL Statement ignored
    HR@XE> exec employees_cache.onerow(100)
    BEGIN employees_cache.onerow(100); END;
    ERROR at line 1:
    ORA-06550: line 1, column 7:
    PLS-00221: 'ONEROW' is not a procedure or is undefined
    ORA-06550: line 1, column 7:
    PL/SQL: Statement ignoredNo joy.
    Of course, now that I'm looking at it again, it seems that the way to go is indicated by the first error:
    PLS-00428: an INTO clause is expected in this SELECT statement
    So am I supposed to create a type of EMPLOYEES%ROWTYPE in a PL/SQL procedure, and the idea of this code, is that the first call to onerow() runs the initialiation code, which populates the cache, and all subsequent calls to onerow() (whether by my session or any other) will use the cache?
    I've had a stab at this, but still, no joy:
    create or replace procedure testcache is
        emp employees%rowtype;
        begin
            select employees_cache.onerow(100) from dual into emp;
            dbms_output.put_line('Emp id: ' || emp.employee_id);
        end testcache;
    show errors
    HR@XE> @testcache.sql
    Warning: Procedure created with compilation errors.
    Errors for PROCEDURE TESTCACHE:
    LINE/COL ERROR
    4/9      PL/SQL: SQL Statement ignored
    4/54     PL/SQL: ORA-00933: SQL command not properly ended
    HR@XE>Have a feeling this should be really easy. Can anybody help?
    Many thanks in advance.
    Jason
    Edited by: 942375 on 08-Feb-2013 11:45

    >
    Ha, figured it out
    >
    Hopefully you also figured out that the example is just that: a technical example of how to use certain Oracle functionality. Unfortunately it is also an example of what you should NOT do in an actual application.
    That code isn't scaleable, uses expensive PGA memory, has no limit on the amount of memory that might be used and, contrary to your belief will result in EVERY SESSION HAVING ITS OWN CACHE of exactly the same data if the session even touches that package.
    Mr. Feuerstein is an expert in SQL and PL/SQL and his books cover virtually all of the functionality available. He also does an excellent job of providing examples to illustrate how that functionality can be combined and used. But the bulk of those examples are intended solely to illustrate the 'technical' aspects of the technology. They do not necessarily reflect best practices and they often do not address performance or other issues that need to be considered when actually using those techniques in a particular application. The examples show WHAT can be done but not necessarily WHEN or even IF a given technique should be used.
    It is up to the reader to learn the advantages and disadvantages of each technicalogical piece and determine when and how to use them.
    >
    Now, I have just done some googling, and it seems that what I am trying to do isn't possible. Apparently %ROWTYPE is PL/SQL, and not understood by SQL, so you can't call onerow() from sql. Correct?
    >
    That is correct. To be used by SQL you would need to create SQL types using the CREATE TYPE syntax. Currently that syntax does not support anything similar to %ROWTYPE.
    >
    So am I supposed to create a type of EMPLOYEES%ROWTYPE in a PL/SQL procedure, and the idea of this code, is that the first call to onerow() runs the initialiation code, which populates the cache, and all subsequent calls to onerow() (whether by my session or any other) will use the cache?
    >
    NO! That is a common misconception. Each session has its own set of package variables. Any session that touches that package will cause the entire EMPLOYEES table to be queried and stored in a new associative array specifically for that session.
    That duplicates the cache for each session using the package. So while there might be some marginal benefit for a single session to cache data like that the benefit usually disappears if multiple sessions are involved.
    The main use case that I am aware of where such caching has benefit is during ETL processing of staged data when the processing of each record is too complex to be done in SQL and the records need to be BULK loaded and the data manipulated in a loop. Then using an associative array as a lookup table to quickly get a small amount of data can be effective. And if the ETL procedure is being processed in parallel (meaning different sessions) then for a small lookup array the additional memory use is tolerable.
    Mitigating against that is the fact that:
    1. Such frequently used data that you might store in the array is likely to be cached by Oracle in the buffer cache anyway
    2. Newer versions of Oracle now have more than one cache
    3. The SQL query needed to get the data from the table will use a bind variable that eliminates repeated hard parsing.
    4. The cursor and the buffer caches ARE SHARED by multiple sessions globally.
    So the short story is that there would rarely be a use case where ARRAYs like that would be preferred over accessing the data from the table.

  • How to get the size of physical memory by using system call ?

    how to get the size of physical memory by using system call ?What system call can be used for me to get the size of physical memor? thanks.

    %vmstat 3
    procs memory page disk faults cpu
    r b w swap free re mf pi po fr de sr s0 -- -- -- in sy cs us sy id
    0 0 0 3025816 994456 4 19 6 0 0 0 0 8 0 0 0 459 253 139 1 1 99
    0 0 0 2864688 777408 0 2 0 0 0 0 0 3 0 0 0 428 134 175 0 1 99
    0 0 0 2864688 777408 0 0 0 0 0 0 0 7 0 0 0 448 112 166 0 0 100
    one interesting observation about vmstat I found out is (mostly on Solaris)
    the first line of information always off chart, so I usually do a few interval to get constant result.
    if you use linux
    just
    cat /proc/meminfo

  • How to use system call in assembler

    I write codes to display the dictionary using C,
    and it can run well,and then I want to use system call
    in assembler to realize the same function ,but it doesn't
    display the dictionary,how to correct it?
    Look:
    //C
    #include <stdio.h>
    int main()
    char *name[2];
    name[0]="/bin/ls";
    name[1]=NULL;
    execve(name[0],name,NULL);
    return 0;
    //Assembler
    .data
    msg:.string "/bin/ls"
    .text
    .global _start
    _start:
    movl $0xb,%eax
    movl $msg,%ebx
    mov $msg,%ecx
    movl $0,%edx
    int $0x80
    movl $1,%eax
    movl $0,%ebx
    int $0x80

    If you compile with -Wwrite-strings, as I like to do for new code, you'll notice it warns about assigning the address of read-only memory to a plain char *. You might want to declare name as follows to avoid accidentally trying to modify it:
    char const *name[2];
    But as for your question. The execve system call requires a pointer to a list (array) of pointers to strings in %ecx. You are passing it a pointer to a single string, which means it will try to interpret the string ("/bin/ls")as a series of pointers to strings, with potentially disastrous (and certainly weird) results.
    Last edited by Trent (2012-12-28 15:31:38)

  • How can utilize/use  the extended space in system.img ?

    Hello Guru's
    In Oracle VM , How can utilize/use the extended space in system.img ?
    a) Increased the system.img size using the following command:
    # dd if=/dev/zero bs=1M count=12960 >> /OVS/running_pool/18_test1/System.img
    b) Verified the added size of system.img file at OVS server.
    # ls -lh System.img
    -rw-r--r-- 1 root root 19G Feb 9 20:58 System.img
    c) Started GVM and additional size/memory is not shown ?
    # df -m
    Filesystem 1M-blocks Used Available Use% Mounted on
    /dev/xvda2 3984 2292 1652 59% /
    /dev/xvda1 92 12 75 14% /boot
    tmpfs 512 0 512 0% /dev/shm
    + Tried working with resizefs , resize2fs , cmd did not work.
    (GVM is created using Oracle provided template)
    + am i missing anything ?
    Oracle VM Setup Detail:
    oracle-logos-4.9.17-7ovs
    enterprise-linux-ovs-5-0.17
    ovs-release-2.2-0.17
    ovs-utils-1.0-33
    kernel-ovs-2.6.18-128.2.1.4.9.el5
    ovs-agent-2.3-29
    Thanks in advance for your help.
    Best Regards
    Basu

    I am not positive what you did is going to work, but it seems like you did the equivalent of imaging a small disk on a bigger disk. In that case, the first thing to do is update the partition table with fdisk. Start with fdisk -l in the vm for general information about the disk. Hopefully, the additional space will show. Then, work with fdisk to use the extra space. The easiest is to add a partition, then a file system on it. It is also possible to expand the last partition (you might have to delete it first), then expand what is on it (may be RAID, LVM, or the file system), layer by layer. As usual with fdisk, you run the risk of thrashing it all, so you may want to practice on a copy first. Obviously, the extra space can only be added to the last partition of the small disk.
    If the situation is more complex, you may have to boot a VM with both the small disk and the big disk at the same time. If you boot the VM off of an iso DVD image, you can then shell out, then run fdisk to partition the big disk the way you want, then use dd to copy the partitions you want in the order you want from the small disk. I am pretty sure not all combinations will work, but you get the idea. You can then take the small disk out, and boot off of the big disk.
    Come to think of it, you might just be better off with adding more space as a second virtual disk. You would then be free to partition/format it the way you want without messing with the first disk. Linux is so good with disk management, so many options.
    As a general statement, though, I like to put some distance between the high level file systems and the low level disk partitions, so I use LVM (Logical Volume Manager).
    Best of luck, keep us posted.

  • How to get physical memory by using system call ?

    how to get physical memory by using system call ?What system call can I use.thanks

    Use sysconf(3C) with SCPHYS_PAGES

  • How can i use my smart TV as a second monitor for my Power mac (2010) via HDMI cable? i've made the connection but no options show in system prefs display.

    How can i use my smart TV as a second monitor for my Power mac (2010) via HDMI cable? i've made the connection but no options show in system prefs display.
    the computer:Mac Pro, Mac OS X (10.9.5), 2 x 2.66 Ghz 6-Core intel Xeon
    the TV: LG Smart tv

    The Mac uses a highly-parameterized universal Driver for every display. The parameters are set at certain times when a query is sent to your display. The display MUST answer with its name and capabilities, or the screen stays dark. A TV set that is off or "not paying attention" because it is set to a different port when the query occurs will rarely answer, and so will often remain dark.
    You can use tools in the System Report to see whether your display has been detected at all. If it has, the report will look something like this, but its name will appear:
    The times when the query is sent are:
    • at Startup
    • at wake from sleep
    • when the Mac-end of the cable is inserted
    • when using the Option ( Detect Displays ) button in displays preferences

  • How can i use iphone 4 to make video calls through 3G network

    Pls let me know how can I use my IPhone4 to make video calls through my Airtel 3G network. Also pls suggest if any alternate is available. Thanks

    Re: Skype
    If I used skype wouldn't I only ge able to call other Skype users??

  • My camera does not work after I restored the system, how can I use it again?

    My camera does not work after I restored the system, how can I use it again?
    Thank you for your help!

    Did try to restore "as new device" without using the backup after that?
    Did you try to reset the phone by holding the sleep and home button until the Apple logo coes back again?

  • Before downloading lion, i want to backup my computer with time machine and a G-DRIVE Slim.  But how can i use time machine to only backup my system once?

    Just wondering, how can i use time machine to only backup my system once? Just this once and not on a weekly basis?

    Upgrade. My three year old Mac Pro and year old MacBook Pro have no problem. Both seem faster.
    And there's your problem reading entirely subjective views on forums, from people that might or might not have decently maintained systems, good operating practices, or whatever.... 
    Strangely, when most companies issue new software, it is because they believe (and believe they have checked) that it is better than the previous version.

  • How can I  get System dates  with time scheduler using threads

    how can I get System dates with time scheduler using threads.is there any idea to update Date in my application along with system Date automatic updation...

    What the heck are you talking about and whatr has it to do with threads?
    Current time: System.currentTimeMillis. Date instances are not supposed to be updated.

Maybe you are looking for

  • Error while building sample application "Developing an Order Application"

    hi , I tried to create a simple Mobile application using the instructions for "Tutorial: Developing an Order Application for Handhelds" given at :- http://help.sap.com/saphelp_nwmobile71/helpdata/en/46/7294498d870ad3e10000000a11466f/frameset.htm For

  • Downloaded popcorn but won't install

    I just bought popcorn 2.0 and downloaded it from the site. When I try to install it it says to drag into applications folder which I did. When I open it from my appl folder it says the same thing-drag to appl folder- What am I doing wrong?

  • Where are the Autosaves?

    Hi, I just edited (the 2nd Time) for some hours a multitrack Project in Sb. It crashed. I did not save, as my last edit crashed while saving and I wasn't able to open the .asnd File. Now here's my Question. Is there a autosave somewhere if the file w

  • Cisco 1242AP and wireless distribution system

    Cisco AIR AG1242AP-E-K9 does the Cisco 1242 access point support WDS as in 'Wireless Distribution System'? (not wireless domain service). I'm trying to configure my 1242 as a wireless bridge to connect to an O2wireless box router but without success.

  • Role Create and Update Workflow

    I'm trying to use the ROLE FORM in a developed role management process to create or update roles. Although all my standard role fields come up, we're running in to several issues: 1. the form doesn't list the new resources in the formtable (showing r