select() i sreturning very big integer values.

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • afrah
    New Member
    • Jul 2010
    • 12

    select() i sreturning very big integer values.

    i use select to let the program sleep for an hour.
    After the time expires it looks up a directory for files dumped in there in this hour.
    the program then parses these file.
    If there r no files in the directory select() should return after time expiry with 0.
    but in my case select() is returning with very big integer values evry hour.
    Can some1 please help m
  • Banfa
    Recognized Expert Expert
    • Feb 2006
    • 9067

    #2
    How do you print out the value, what type of integer do you store the return in?

    select returns -1 on error but if you print -1 as an unsigned value you get a very large integer.

    If it returns -1 then the error is in errno

    Comment

    • afrah
      New Member
      • Jul 2010
      • 12

      #3
      My return value is of type int.

      Comment

      • weaknessforcats
        Recognized Expert Expert
        • Mar 2007
        • 9214

        #4
        select() is supposed to return 0 if there are no files and a non-zero value otherwise. A non-zero value can be a big number.

        Comment

        • afrah
          New Member
          • Jul 2010
          • 12

          #5
          Originally posted by weaknessforcats
          select() is supposed to return 0 if there are no files and a non-zero value otherwise. A non-zero value can be a big number.
          There are no files still select is returning a big number.

          Comment

          • Banfa
            Recognized Expert Expert
            • Feb 2006
            • 9067

            #6
            What is the number being returned?

            Comment

            • afrah
              New Member
              • Jul 2010
              • 12

              #7
              Originally posted by Banfa
              What is the number being returned?
              Its always big integer numbers like select returned 235038384.
              select returned 235281536.
              select returned 235514992.
              select returned 235654336.
              select returned 235839360.
              select returned 236132480.
              select returned 236311568.
              select returned 236421936.
              select returned 236671216.

              Comment

              • Banfa
                Recognized Expert Expert
                • Feb 2006
                • 9067

                #8
                I think you had better show us the code too.

                Comment

                • donbock
                  Recognized Expert Top Contributor
                  • Mar 2008
                  • 2427

                  #9
                  What is the run-time environment (processor and operating system)?

                  What header do you include to get the prototype for select?

                  Comment

                  Working...