Sign in Join

Live chat for Free Pascal, Lazarus, Delphi and every Pascal programmer.

Mailing lists / fpc-pascal / 2010-04

Inotify low-level functions

2 messages · 2 people · –

Reply by email Subscribe to this list Your subscription

Read-only archive. Use j and k to move between messages.

Michał 'rysiek' Woźniak

Hi there,

Some time ago (2 years, actually) I needed to implement inotify support for FPC; never got around to contributing... well, the time has come. :)

As far as I can tell, the Inotify Linux kernel interface hasn't got decent support in FPC yet, right?

So, here are my questions:
- where should I put the inotify_init() and other low-level functions (actually, wrappers around system calls)? It used to be Linux.pas, but I hear that's deprecated...
- how do I contribute so that the code gets into the right file? Branch? Send diffs/patches?
- where/how should I contribute a bit higher-level stuff (more usable interface functions, plus an object-oriented interface)?

Cheers Michał 'rysiek' Woźniak Laboratorium BRAMA, WEiTI, PW
Marco van de Voort
to Michał 'rysiek' Woźniak

In our previous episode, Micha? 'rysiek' =?utf-8?q?_Wo=C5=BAniak?=" said:

Show quoted text 10 lines
Some time ago (2 years, actually) I needed to implement inotify support for FPC; never got around to contributing... well, the time has come. :) As far as I can tell, the Inotify Linux kernel interface hasn't got decent support in FPC yet, right? So, here are my questions: - where should I put the inotify_init() and other low-level functions (actually, wrappers around system calls)? It used to be Linux.pas, but I hear that's deprecated...

No. Linux is fine. The "old" linux is deprecated, which was what now is baseunix and Unix. The "new" Linux unit is exactly for this, linux specific kernel interfaces.

Please try to set it up in a way that it works for all Linuxes though (so keep 32/64bit, endianness and non-x86 in mind)

- how do I contribute so that the code gets into the right file? Branch? Send diffs/patches?

Open a mantis bug ticket, with as clean as possible patches, with some demo programs. This allows the committer to evaluate patches easily, and e.g. retarget them to a different unit without editing for days.

- where/how should I contribute a bit higher-level stuff (more usable interface functions, plus an object-oriented interface)?

Higher level interfaces usually get a crossplatform package in packages/. So that would require to define a subset of the functionality that is implementable on the core platforms (kevent on FreeBSD and afaik also OS X, and Windows also has some notify mechanism) (otherwise we end up with umpteen thin linux/x86 object wrappers)

This is also why nothing has happened here. It takes some dedication to make this happen. But now in the VM age, it has become a lot easier to test on e.g. Freebsd.