× The internal search function is temporarily non-functional. The current search engine is no longer viable and we are researching alternatives.
As a stop gap measure, we are using Google's custom search engine service.
If you know of an easy to use, open source, search engine ... please contact support@midrange.com.



fcntl() seems to be capable of the job but I'm not sure that I am =) ... but I'll give it a try.

Thanx.

Mihael

-----Ursprüngliche Nachricht-----
Von: c400-l-bounces+mihael.schmidt=rossmann.de@xxxxxxxxxxxx [mailto:c400-l-bounces+mihael.schmidt=rossmann.de@xxxxxxxxxxxx] Im Auftrag von Elvis Budimlic
Gesendet: Donnerstag, 11. Juni 2009 17:42
An: 'C programming iSeries / AS400'
Betreff: Re: [C400-L] lockf() on system i

As I'm unfamiliar with the lockf() function I googled it and it appears that
in some situations a fcntl() can serve as a substitute. Since fcntl() is
available on the System i, could it do what you need?
You can see the system header file pertaining to this by running this
command on a green-screen command line:

WRKMBRPDM QSYSINC/H FCNTL

Hth, Elvis

Celebrating 11-Years of SQL Performance Excellence on IBM i, i5/OS and
OS/400
www.centerfieldtechnology.com

-----Original Message-----
Subject: [C400-L] lockf() on system i

Hi,

I'm quite new to C especially ILE C and am trying to port a software written
in C (with target platform Linux/Unix) to ILE C.

The software uses the lockf() function which is available on other platforms
but not on System i.

The "UNIX C Applications Porting to AS/400 Companion Guide" also points out
that there are problems but gives a function which should be used for
lockf().

On most (probably all) systems lockf the following declaration:
int lockf(int fildes, int function, off_t size);

But the function from the IBM redbook has:
int lockf(_RFILE *fildes, int function, int size)

Where _RFILE is:

typedef _Packed struct {
char reserved1[16];
volatile void *const *const in_buf;
volatile void *const *const out_buf;
char reserved2[48];
_RIOFB_T riofb;
char reserved3[32];
const unsigned int buf_length;
char reserved4[28];
volatile char *const in_null_map;
volatile char *const out_null_map;
volatile char *const null_key_map;
char reserved5[48];
const int min_length;
short null_map_len;
short null_key_map_len;
char reserved6[8];
} _RFILE;

What do I have to do to get these two worlds together ?

For those interested: I try to port the template engine ClearSilver
(www.clearsilver.net) to ILE C to be able to use it from RPG.

Any ideas?

Thanx in advance

Mihael Schmidt




As an Amazon Associate we earn from qualifying purchases.

This thread ...

Follow-Ups:
Replies:

Follow On AppleNews
Return to Archive home page | Return to MIDRANGE.COM home page

This mailing list archive is Copyright 1997-2024 by midrange.com and David Gibbs as a compilation work. Use of the archive is restricted to research of a business or technical nature. Any other uses are prohibited. Full details are available on our policy page. If you have questions about this, please contact [javascript protected email address].

Operating expenses for this site are earned using the Amazon Associate program and Google Adsense.