id	summary	reporter	owner	description	type	status	priority	milestone	component	version	resolution	keywords	cc	blockedby	blocking	branch_state	votes
2516	mc fails to build on DragonFlyBSD	cheusov		"mc fails to build on DragonFlyBSD with the following error message.

    vfs.c: In function 'mc_readdir':
    vfs.c:802: error: 'MAXNAMLEN' undeclared (first use in this function)
    vfs.c:802: error: (Each undeclared identifier is reported only once
    vfs.c:802: error: for each function it appears in.)
    *** Error code 1

This is because !DragonFly doesn't provide MAXNAMLEN macros in its header files. Their dirent structure is define like the following.

struct dirent {
#if defined(_KERNEL) || !defined(__BSD_VISIBLE)
        ino_t           d_ino;          /* file number of entry */
#else
        ino_t           d_fileno;       /* file number of entry */
#endif
        uint16_t        d_namlen;       /* strlen(d_name) */
        uint8_t         d_type;         /* file type, see blow */
        uint8_t         d_unused1;      /* padding, reserved */
        uint32_t        d_unused2;      /* reserved */
        char            d_name[255 + 1];
                                        /* name, NUL-terminated */
};

Attached patch solves the problem.
"	defect	new	major	4.8	mc-vfs	4.7.5		dragonflybsd vfs					
