Beefy Boxes and Bandwidth Generously Provided by pair Networks
Your skill will accomplish
what the force of many cannot

linux/fs.h constants?

by jfroebe (Parson)
on Jan 26, 2016 at 16:12 UTC ( #1153686=perlquestion: print w/replies, xml ) Need Help??

jfroebe has asked for the wisdom of the Perl Monks concerning the following question:

Hi all,

I'm having rather large brain fart and my google-fu is on the fritz today. I'm looking for the module to use that will give me access to the constants in linux/fs.h header file. The following chunk of the fs.h is what I'm interested in.

/* the read-only stuff doesn't really belong here, but any other place + is probably as bad and I don't want to create yet another include file +. */ #define BLKROSET _IO(0x12,93) /* set device read-only (0 = read-writ +e) */ #define BLKROGET _IO(0x12,94) /* get read-only status (0 = read_writ +e) */ #define BLKRRPART _IO(0x12,95) /* re-read partition table */ #define BLKGETSIZE _IO(0x12,96) /* return device size /512 (long *arg) + */ #define BLKFLSBUF _IO(0x12,97) /* flush buffer cache */ #define BLKRASET _IO(0x12,98) /* set read ahead for block device */ #define BLKRAGET _IO(0x12,99) /* get current read ahead setting */ #define BLKFRASET _IO(0x12,100)/* set filesystem (mm/filemap.c) read- +ahead */ #define BLKFRAGET _IO(0x12,101)/* get filesystem (mm/filemap.c) read- +ahead */ #define BLKSECTSET _IO(0x12,102)/* set max sectors per request (ll_rw_ +blk.c) */ #define BLKSECTGET _IO(0x12,103)/* get max sectors per request (ll_rw_ +blk.c) */ #define BLKSSZGET _IO(0x12,104)/* get block device sector size */ #if 0 #define BLKPG _IO(0x12,105)/* See blkpg.h */ /* Some people are morons. Do not use sizeof! */ #define BLKELVGET _IOR(0x12,106,size_t)/* elevator get */ #define BLKELVSET _IOW(0x12,107,size_t)/* elevator set */ /* This was here just to show that the number is taken - probably all these _IO(0x12,*) ioctls should be moved to blkpg.h. * +/ #endif /* A jump here: 108-111 have been used for various private purposes. * +/ #define BLKBSZGET _IOR(0x12,112,size_t) #define BLKBSZSET _IOW(0x12,113,size_t) #define BLKGETSIZE64 _IOR(0x12,114,size_t) /* return device size in b +ytes (u64 *arg) */ #define BLKTRACESETUP _IOWR(0x12,115,struct blk_user_trace_setup) #define BLKTRACESTART _IO(0x12,116) #define BLKTRACESTOP _IO(0x12,117) #define BLKTRACETEARDOWN _IO(0x12,118) #define BLKDISCARD _IO(0x12,119) #define BLKIOMIN _IO(0x12,120) #define BLKIOOPT _IO(0x12,121) #define BLKALIGNOFF _IO(0x12,122) #define BLKPBSZGET _IO(0x12,123) #define BLKDISCARDZEROES _IO(0x12,124)

Jason L. Froebe

Tech Blog

Replies are listed 'Best First'.
Re: linux/fs.h constants?
by RichardK (Parson) on Jan 26, 2016 at 22:54 UTC

    I see no constants there, only preprocessor macros. So you'll have to convert them in the same way the C preprocessor does, maybe using the module already referred to.

Re: linux/fs.h constants?
by Anonymous Monk on Jan 26, 2016 at 17:56 UTC

    Will this not do: h2ph?

      I could use that but why reinvent the wheel?

      Jason L. Froebe

      Tech Blog

        I could use that(wheel) but why reinvent the wheel?


Log In?

What's my password?
Create A New User
Node Status?
node history
Node Type: perlquestion [id://1153686]
Approved by Corion
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others wandering the Monastery: (2)
As of 2021-04-12 03:19 GMT
Find Nodes?
    Voting Booth?

    No recent polls found