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 8186011
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 7, 20262026-06-07T02:03:12+00:00 2026-06-07T02:03:12+00:00

I am getting started in linux device driver development and I often see this

  • 0

I am getting started in linux device driver development and I often see this kind of code and am unable to understand what it exactly does:

#<linux/fs.h>
loff_t (*llseek) (struct file *, loff_t,int);

The llseek method is used to change the read write position in a file.The loff_t is a long offset parameter.
What I dont understand is the above syntax and how it actually works.
Could someone please shed some light?

  • 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-06-07T02:03:14+00:00Added an answer on June 7, 2026 at 2:03 am
        loff_t (*llseek) (struct file *, loff_t,int);
    

    This just says that llseek is a pointer to a function that returns a loff_t and takes three parameters. The first parameter is a pointer to a struct file. The second is a loff_t. The third is an int.

    However, if you look closely, you’ll see it appears inside the declaration for struct file_operations. This means that struct file_operations contains a member called llseek that is a pointer to a function that returns a loff_t and takes those three parameters.

    By the way, if you don’t understand how to do OOP programming in C by using things like structures that contain pointers to functions, you really have no business going anywhere near a kernel device driver. (If you’re familiar with C++, then just understand that a structure with pointers to functions is basically the way you fake a class in C.)

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Just getting started with Obj-C and iOS programming. I have some code that loads
I am just getting started with gcc on Linux. I am following the tutorial
I'm following the CUDA-GDB guide (page 10, getting started) on Ubuntu Linux and got
Alright, I'm having trouble getting started on this one. I'm trying to use the
For someone familiar with Linux kernel programming, what are some resources for getting started
I randomly started getting this error today when I try to select from a
I installed wxWidgets-2.8.10 following instructions from this page: http://wiki.wxwidgets.org/Compiling_and_getting_started Libraries directory: alex@alex-linux:/usr/local/lib$ ls |
Getting started with NHibernate How can I generate identity fields in nHibernate using Hilo
Getting started with TDD and I want to ground up a Repository-driven Model. However,
getting started with osgi, i wonder what's the conceptual diffence between bundles and components.

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.