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

Add support for Solaris-based OSs #533

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ Finds…
- ``btrfs`` support.
- ...

It runs and compiles under most Unices, including Linux, FreeBSD and Darwin.
It runs and compiles under most Unices, including Linux, FreeBSD, Darwin and Solaris.
The main target is Linux though, some optimisations might not be available
elsewhere.

Expand Down
4 changes: 4 additions & 0 deletions lib/formats/progressbar.c
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,10 @@

#include <sys/ioctl.h>

#if defined(__sun)
#include <sys/termios.h>
#endif

typedef struct RmFmtHandlerProgress {
/* must be first */
RmFmtHandler parent;
Expand Down
4 changes: 4 additions & 0 deletions lib/formats/stats.c
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,10 @@

#include <sys/ioctl.h>

#if defined(__sun)
#include <sys/termios.h>
#endif

#define ARROW \
fprintf(out, "%s==>%s ", MAYBE_YELLOW(out, session), MAYBE_RESET(out, session));

Expand Down
4 changes: 4 additions & 0 deletions lib/formats/summary.c
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,10 @@

#include <sys/ioctl.h>

#if defined(__sun)
#include <sys/termios.h>
#endif

typedef struct RmFmtHandlerSummary {
/* must be first */
RmFmtHandler parent;
Expand Down
2 changes: 2 additions & 0 deletions lib/utilities.h
Original file line number Diff line number Diff line change
Expand Up @@ -106,6 +106,8 @@ WARN_UNUSED_RESULT static inline int rm_sys_lstat(const char *path, RmStat *buf)
static inline gdouble rm_sys_stat_mtime_float(RmStat *stat) {
#if RM_IS_APPLE
return (gdouble)stat->st_mtimespec.tv_sec + stat->st_mtimespec.tv_nsec / 1000000000.0;
#elif defined(__sun) && !(!defined(__XOPEN_OR_POSIX) || defined(__EXTENSIONS__))
return (gdouble)stat->st_mtim.__tv_sec + stat->st_mtim.__tv_nsec / 1000000000.0;
#else
return (gdouble)stat->st_mtim.tv_sec + stat->st_mtim.tv_nsec / 1000000000.0;
#endif
Expand Down
4 changes: 4 additions & 0 deletions src/rmlint.c
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,10 @@
*
**/

#if defined(__sun)
#define _POSIX_C_SOURCE 200809L
#endif

#include <locale.h>
#include <stdlib.h>
#include <string.h>
Expand Down