Search:

Type: Posts; User: heatblazer

Page 1 of 5 1 2 3 4

Search: Search took 0.01 seconds.

  1. Replies
    4
    Views
    2,910

    Undefined behaviour?

    Undefined behaviour?
  2. Replies
    4
    Views
    2,910

    Unknown woriking code on merging arrays

    Hello,

    I am reading a code, that is working, but I think it's wrong, and it should crash, but it does not. It merges Array1 into Array2 if there is enough space in Array2 to fit it, but first...
  3. Replies
    1
    Views
    1,231

    Simple asci drawing algorithm

    Hello, it`s not exactly C/C++ related even though written in C/C++. It`s an algo to draw a triangle but I am missing one draw iterration.



    static void set_char_at(char* mat, int cols, int x,...
  4. Replies
    2
    Views
    1,586

    Trim function, possible leaks?

    Hello, I am interested if that trim function is OK to be used, with no leaks possible.


    static void trim(char* data)
    {
    char* begin= data;
    char* end = &data[aux_strlen(data)-1];
    ...
  5. Replies
    1
    Views
    3,626

    UNIX mkfifo fails on a different files

    Hello, I am trying to complete a finite IPC machine. For some unknown reason to me, mkfifo never succeeds. My first few atempts, it does after that it always return a non-zero value (which by the...
  6. Thanks, I`ll consider it.

    Thanks, I`ll consider it.
  7. Also my repo is here GitHub -...

    Also my repo is here
    GitHub - heatblazer/unix-ipc: inter proc communication
    anyone who wish to give me a hand is welcome.
  8. I was thinking of 3rd program which is the bridge...

    I was thinking of 3rd program which is the bridge between the two. The sender sends some data, the bridge has the function to work on it, let`s say it populates a struct with char data and return...
  9. That is bad :( Ok what if I made an auxilary .o...

    That is bad :( Ok what if I made an auxilary .o file that is passed to both sender and receiver?
  10. Passing functions via UNIX FIFO, is it possible?

    Hello,
    I am playing with the linx FIFO and mknod. As simple example as opening two programs "sender" and "receiver", and a FIFO between them, it seems that they can exchange buffers. However the...
  11. I`ve found a way to restore the object via the...

    I`ve found a way to restore the object via the cast from the buffer:
    After reading the object to a char buffer with a sufficiet size:


    struct a* pa = (struct a*) buff;


    Also the serialize...
  12. Dump C struct (object) to a file and restore it back (serialize)

    Hello, I am trying to serialize a simple C struct. I am dumping it to a file then try to read and restore it. However I got wrong data. Here is my idea:

    #include <stdio.h>#include <stdlib.h>...
  13. Replies
    1
    Views
    5,003

    C socket recv in a infinite loop.

    Hello,
    I have the following code, which I intend to recieve messages form a server but for now it recieves only on send.

    linux-daemon-interface/network at master *...
  14. Replies
    2
    Views
    3,373

    A lockfree example

    Hello, I am experimenting with a lock free simple list for inserting data:



    #include<stdio.h>#include<stdlib.h>#include<pthread.h>
    typedefstruct_n{intdata;struct_n*next;}node;...
  15. Hello, actually I had a wrong iterator for...

    Hello,
    actually I had a wrong iterator for printing the list, but thanks for the reminder of the joining the threads.



    //node* it = (&s_head);
    node* it = *(&s_head);

    I was iterating to...
  16. thread or mutex SIGTRAP in multiple threads program

    Hello,
    I am trying a multithreaded code but I am recieving sigtrap. I am trying to test a round robin algorithm but somehow I am SIGTRAPing in the atomic_push function.





    typedef struct...
  17. I`ve heard also about offsetof macro which can be...

    I`ve heard also about offsetof macro which can be used to acces N-th member of the struct but how can I achieve this via a raw buffer, that comes from the pipe?
  18. C unix program to call remote procedures with FIFO?

    Hello, first I want to ask if it`s possible to call a remote procedure via FIFO pipe from unix with standart FIFO producer/consumer algorithm?
    Here is my daemon implementation:...
  19. Replies
    1
    Views
    1,170

    C setsid fails

    Hello,

    I am trying to start a test daemon but setsid keeps failing.


    /*pass main`s args here */
    int start(int argc, char** argv)
    {
    //test interface
    (void)...
  20. Linux, get a device for a sound card and identify it

    Hello,

    I need to determine which device has been connected to a linux system, and with what order the devices are connected. Like if DEV1 is connected to SLOT1 it`s OK, etc. However, I don`t want...
  21. Let`s say I need two instances of that class form...

    Let`s say I need two instances of that class form pjsua2: 4. Endpoint — PJSUA2 Documentation 1.0-alpha documentation
  22. Adapt a singleton class to lose it`s singleton feature

    Hello,
    I have a class that is a singleton. However I need more instances of that class, so I am interested do I have to rewrite the class, or I can adapt it to loose that functionality whithout...
  23. Replies
    11
    Views
    703

    I do agree with your solution. Thanks :)

    I do agree with your solution. Thanks :)
  24. Replies
    11
    Views
    703

    I`ve written a simple type universal macro that...

    I`ve written a simple type universal macro that swaps int 16 or 32 also floats with no problem at all and works for my problems:



    #define ENDIAN_SWAP(Type, Var) \
    { ...
  25. Replies
    11
    Views
    703

    Fixed the swap error but still not swaps ...

    Fixed the swap error but still not swaps


    eswap.c[0] = (eswap.c[0] >> 8) | eswap.c[0]<<8 );
    ...


    I though that the union and the char array will be in the same address so I can acces 4 8...
Results 1 to 25 of 121
Page 1 of 5 1 2 3 4