Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 3310182
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 17, 20262026-05-17T21:43:46+00:00 2026-05-17T21:43:46+00:00

I am trying to add a new helloworld system call to a new version

  • 0

I am trying to add a new helloworld system call to a new version of the Linux Ubuntu kernel. I have been looking through the web but I cannot find a consistent example to show me what files I will have to modify to enable a helloworld system call to be added to the kernel.

I have tried many and compile error have occurred.
I know how to compile the kernel, but I just don’t know where I add my c program system call, and where I add this call to the system call table and anything else I have to do.

I am working on the newest Linux Ubuntu kernel.

I compiled the kernel with a new system call introduced, a simple call called mycall, now I am getting compile errors within the header file of my application that will test the call, below is my header file

#include<linux/unistd.h>

#define __NR_mycall 317

_syscall1(long, mycall, int, i)

This is the syntax error I am getting

stef@ubuntu:~$ gcc -o testmycall testmycall.c
In file included from testmycall.c:3:
testmycall.h:7: error: expected declaration specifiers or ‘...’ before ‘mycall’
testmycall.h:7: error: expected declaration specifiers or ‘...’ before ‘i’
testmycall.c: In function ‘_syscall1’:
testmycall.c:7: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘{’ token
testmycall.h:7: error: parameter name omitted
testmycall.h:7: error: parameter name omitted
testmycall.c:11: error: expected ‘{’ at end of in

I got a lot of help from the below link from Nikolai N Fetissov

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-17T21:43:47+00:00Added an answer on May 17, 2026 at 9:43 pm

    The ‘_syscall1’ macro that you are using is obsolete. Use syscall(2) instead.

    Example:

    #include <stdio.h>
    #include <linux/unistd.h>
    #include <sys/syscall.h>
    
    #define __NR_mysyscall     317
    
    int main(void)
    {
            long return_value;
    
            return_value = syscall(__NR_syscall);
    
            printf("The return value is %ld.\n", return_value);
    
            return 0;
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm trying to add a new node to an jQuery SimpleTree , but all
I'm trying add a tab to my web page that looks like this: Using
Hello I'm trying to add new column to the Excel worksheet by command ALTER
I am trying to add new div elements on the fly to an already
Trying to add an onclick handler to my tabs, and can't seem to get
trying to add an ExpiresDefault ExpiresByType to content on my website so that way
I was trying to add a favicon to a website earlier and looked for
I'm trying to add support for stackoverflow feeds in my rss reader but SelectNodes
I am trying to add a project reference or swc to papervision in FlashDevelop
I am trying to add some custom build steps to my headless build process

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.