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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 19, 20262026-06-19T00:01:25+00:00 2026-06-19T00:01:25+00:00

Upon some conditions, I want to schedule a timer ( struct timer_list ) that

  • 0

Upon some conditions, I want to schedule a timer (struct timer_list) that works on custom data. The function field of this structure holds the actual function that will be triggered, and is defined as below :

void (*function)(unsigned long);

The thing is I want to pass a pointer instead of the unsigned long. I know that depending on the architecture, the int-ptr conversion may or may not be safe, but I could not find if all the architectures align long integers with pointers so here is my question (in fact, a two-in-one) :

Is it safe to perform a long to void* cast ? If no, how should I handle the unsigned long argument to get the data pointer I want in the timer function ?

  • 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-19T00:01:27+00:00Added an answer on June 19, 2026 at 12:01 am

    You could use the passed number to be an index into an array that contains your custom data structure.

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

Sidebar

Related Questions

I want to call a javascript function that will be conditional upon a user's
This is what I want to do: Have a timer with some interval In
I have a project that depends upon some other binaries to be downloaded from
There is an input field, and upon entering some characters in it, jquery shows
I have some logic that depends upon two properties being set, as it executes
I've stumbled upon some behavior in CSS that is confusing to me. Let's say
Upon some research I found two functions in MATLAB to do the task: cvpartition
I recenty stumbled upon some files described as HTML Applications on my Win XP
I've written a simple Java applet to generate a technical image based upon some
I've inherited the following script and it needs to be improved upon some. The

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.