problems with cflowd-2-1-b1 on powerpc-ibm-aix4.3.3.0

From: Shvedko Pavel (
Date: Fri Feb 16 2001 - 00:24:33 PST

  • Next message: Agris: "cflowd man"

    Hello all!

    Found problems in work cflowd-2-1-b1 on powerpc-ibm-aix4.3.3.0. It was incorrect call
    functions ftok and malloc for example

    classes/src/ int mapsemid = semget(ftok((char

    Here second argument is 0. It raise error -1.
    Look at man ftok

         #include <sys/types.h>

         #include <sys/ipc.h>

         key_t ftok (Path, ID)

         char *Path;

         int ID;
         Return Values

         When successful, the ftok subroutine returns a key that can be passed to the
         msgget, semget, or shmget subroutine.

         Error Codes

         The ftok subroutine returns the value (key_t)-1 if one or more of the following
         are true:

           o The file named by the Path parameter does not exist.
           o The file named by the Path parameter is not accessible to the process.
           o The ID parameter has a value of 0.

    classes/src/ char *buf = (char *)malloc(expectedLength);
    classes/src/ if (buf == (char *)0) {

    Condition in line 156 is true when numEntries is 0
    Look at man malloc

         #include <stdlib.h>

         void *malloc (Size)

         size_t Size;
         Return Values

         Each of the allocation subroutines returns a pointer to space suitably aligned
         for storage of any type of object. Cast the pointer to the pointer-to-element
         type before using it.

         The malloc, realloc, calloc , and valloc subroutines return a null pointer if
         there is no available memory, or if the memory arena has been corrupted by being
         stored outside the bounds of a block. When this happens, the block pointed to by
         the Pointer parameter may be destroyed.

         If the malloc or valloc subroutine is called with a size of 0, the subroutine
         returns a null pointer.

    Best regards !

    Shvedko Pavel   phone:(095) 912-5879, 912-3604, 911-3654

    -- cflowd mailing list

    This archive was generated by hypermail 2b29 : Fri Feb 16 2001 - 00:43:16 PST