Initial netbsd support
This commit is contained in:
parent
1990f9b034
commit
4ad48cb305
7 changed files with 84 additions and 4 deletions
15
common/drm.c
15
common/drm.c
|
@ -6,6 +6,11 @@
|
|||
#include <sys/sysmacros.h>
|
||||
#endif
|
||||
|
||||
#if defined(__NetBSD__)
|
||||
#include <stdlib.h>
|
||||
#include <sys/stat.h>
|
||||
#endif
|
||||
|
||||
#include "drm.h"
|
||||
|
||||
// From libdrm
|
||||
|
@ -40,6 +45,16 @@ int path_is_drm(const char *path) {
|
|||
static const int prefixlen = STRLEN(prefix);
|
||||
return strncmp(prefix, path, prefixlen) == 0;
|
||||
}
|
||||
#elif defined(__NetBSD__)
|
||||
int path_is_drm(const char *path) {
|
||||
static const char prefix[] = "/dev/dri/";
|
||||
static const int prefixlen = STRLEN(prefix);
|
||||
return strncmp(prefix, path, prefixlen) == 0;
|
||||
}
|
||||
|
||||
int dev_is_drm(dev_t device) {
|
||||
return major(device) == getdevmajor("drm", S_IFCHR);
|
||||
}
|
||||
#else
|
||||
#error Unsupported platform
|
||||
#endif
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue