Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Issues building on OpenBSD #2464

Open
brad0 opened this issue Dec 25, 2020 · 2 comments
Open

Issues building on OpenBSD #2464

brad0 opened this issue Dec 25, 2020 · 2 comments

Comments

@brad0
Copy link

brad0 commented Dec 25, 2020

I am trying to build the SDK on OpenBSD but have run into a few issues building.

include/mega/posix/megafs.h requires adding OpenBSD to where FreeBSD is.

src/http.cpp OpenBSD does not have AI_V4MAPPED. I had a patch of..

+#ifdef __OpenBSD__
+        hints.ai_flags = AI_ADDRCONFIG;
+#else
         hints.ai_flags = AI_V4MAPPED | AI_ADDRCONFIG;
+#endif

But you might want to handle it in a different manner.

src/posix/fs.cpp:1813:50: error: no member named 'f_type' in 'statfs'
    LOG_info << "Filesystem type: " << statfsbuf.f_type;
                                       ~~~~~~~~~ ^
src/posix/fs.cpp:1819:22: error: no member named 'f_type' in 'statfs'
    return statfsbuf.f_type != 0x4d44 // FAT
           ~~~~~~~~~ ^
src/posix/fs.cpp:1820:22: error: no member named 'f_type' in 'statfs'
        && statfsbuf.f_type != 0x65735546; // FUSE
           ~~~~~~~~~ ^
3 errors generated.

OpenBSD does not have a f_type field. FreeBSD and macOS do.

OpenBSD does have f_fstypename like macOS.

From sys/mount.h...

/* new statfs structure with mount options and statvfs fields */
struct statfs {
	u_int32_t	f_flags;	/* copy of mount flags */
	u_int32_t	f_bsize;	/* file system block size */
	u_int32_t	f_iosize;	/* optimal transfer block size */

					/* unit is f_bsize */
	u_int64_t  	f_blocks;	/* total data blocks in file system */
	u_int64_t  	f_bfree;	/* free blocks in fs */
	int64_t  	f_bavail;	/* free blocks avail to non-superuser */

	u_int64_t 	f_files;	/* total file nodes in file system */
	u_int64_t  	f_ffree;	/* free file nodes in fs */
	int64_t  	f_favail;	/* free file nodes avail to non-root */

	u_int64_t  	f_syncwrites;	/* count of sync writes since mount */
	u_int64_t  	f_syncreads;	/* count of sync reads since mount */
	u_int64_t  	f_asyncwrites;	/* count of async writes since mount */
	u_int64_t  	f_asyncreads;	/* count of async reads since mount */

	fsid_t	   	f_fsid;		/* file system id */
	u_int32_t	f_namemax;      /* maximum filename length */
	uid_t	   	f_owner;	/* user that mounted the file system */
	u_int64_t  	f_ctime;	/* last mount [-u] time */

	char f_fstypename[MFSNAMELEN];	/* fs type name */
	char f_mntonname[MNAMELEN];	/* directory on which mounted */
	char f_mntfromname[MNAMELEN];	/* mounted file system */
	char f_mntfromspec[MNAMELEN];	/* special for mount request */
	union mount_info mount_info;	/* per-filesystem mount options */
};


/*
 * File system types.
 */
#define	MOUNT_FFS	"ffs"		/* UNIX "Fast" Filesystem */
#define	MOUNT_UFS	MOUNT_FFS	/* for compatibility */
#define	MOUNT_NFS	"nfs"		/* Network Filesystem */
#define	MOUNT_MFS	"mfs"		/* Memory Filesystem */
#define	MOUNT_MSDOS	"msdos"		/* MSDOS Filesystem */
#define	MOUNT_AFS	"afs"		/* Andrew Filesystem */
#define	MOUNT_CD9660	"cd9660"	/* ISO9660 (aka CDROM) Filesystem */
#define	MOUNT_EXT2FS	"ext2fs"	/* Second Extended Filesystem */
#define	MOUNT_NCPFS	"ncpfs"		/* NetWare Network File System */
#define	MOUNT_NTFS	"ntfs"		/* NTFS */
#define	MOUNT_UDF	"udf"		/* UDF */
#define	MOUNT_TMPFS	"tmpfs"		/* tmpfs */
#define	MOUNT_FUSEFS	"fuse"		/* FUSE */
@brad0
Copy link
Author

brad0 commented Mar 17, 2021

ping.

@brad0
Copy link
Author

brad0 commented Jun 18, 2023

I noticed the src/posix/fs.cpp issue has been resolved with the relevant code being ifdef __liniux__'d.

I created a PR #2650 to take care of the rest.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant