Git Product home page Git Product logo

Comments (2)

GoogleCodeExporter avatar GoogleCodeExporter commented on June 25, 2024
Ugh. Solaris seems to have manual pages claiming it has flock() but they lie.

Probably I should rewrite this using fcntl() which is probably more portable.

Probably the function would change to something like:

snooze(int seconds)
{
    int slfd;
    struct flock lock;
    lock.l_type= F_WRLCK;
    lock.l_whence= SEEK_SET;
    lock.l_start= 0;
    lock.l_len= 0;

    /* Lock the sleep-lock file to serialize our sleeps */

    if ((slfd= open(SLEEP_LOCK,O_CREAT|O_RDWR,0644)) >= 0)
        fcntl(slfd,F_SETLKW,&lock);

    sleep(seconds);

    /* Release sleep-lock file */
    /*lock.l_type= F_UNLCK; fcntl(slfd,F_SETLK,&lock);*/
    close(slfd);
}

But I haven't tested that at all.

Original comment by [email protected] on 5 Oct 2011 at 4:16

  • Changed state: Accepted

from pwauth.

GoogleCodeExporter avatar GoogleCodeExporter commented on June 25, 2024
Version 2.3.10 has been modified to use fcntl() locking instead of flock() 
locking. Since fcntl() is a POSIX standard, I believe it should be more 
portable and should work on Solaris.

Original comment by [email protected] on 6 Oct 2011 at 2:32

  • Changed state: Fixed

from pwauth.

Related Issues (8)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.