Back to index

libdrm  2.4.37
getclient.c File Reference
#include <limits.h>
#include "drmtest.h"

Go to the source code of this file.


int main (int argc, char **argv)

Function Documentation

int main ( int  argc,
char **  argv 


Definition at line 34 of file getclient.c.

       int fd, ret;
       drm_client_t client;

       fd = drm_open_any();

       /* Look for client index 0.  This should exist whether we're operating
        * on an otherwise unused drm device, or the X Server is running on
        * the device.
       client.idx = 0;
       ret = ioctl(fd, DRM_IOCTL_GET_CLIENT, &client);
       assert(ret == 0);

       /* Look for some absurd client index and make sure it's invalid.
        * The DRM drivers currently always return data, so the user has
        * no real way to detect when the list has terminated.  That's bad,
        * and this test is XFAIL as a result.
       client.idx = 0x7fffffff;
       ret = ioctl(fd, DRM_IOCTL_GET_CLIENT, &client);
       assert(ret == -1 && errno == EINVAL);

       return 0;

Here is the call graph for this function: