In article <20140321225300.547d960...@jupiter.mumble.net>, Taylor R Campbell <campbell+netbsd-source-change...@mumble.net> wrote: > Date: Fri, 21 Mar 2014 22:51:15 +0000 (UTC) > From: chris...@astron.com (Christos Zoulas) > > >+#ifdef __NetBSD__ /* XXX */ > > That ifdef could just be DRM_IOCTL_MMAP > >I guess so, but it's only on NetBSD that mmap actually doesn't work >and you have to use DRM_IOCTL_MMAP. It's also sleazy enough that I >made us define our own ioctl; I don't want to tempt fate by pretending >it's a general non-NetBSD API (yet).
If someone adopts it, then they'll have to change the code in many places which is not worth it. Plus upstream probably likes fewer OS specific defines. > >+ static const struct drm_mmap zero_mmap_req; > >+ struct drm_mmap mmap_req = zero_mmap_req; > > struct drm_mmap map_req = { 0 }; works just fine? > >In this case it does, but I got in the habit of the above pattern >because `= { 0 }' doesn't work if the first member in the structure >type is not an integer or pointer. Would be nice if `= {}' worked, >but it's not standard. Yes, in this case it does, so do it :-) christos