Thanks to Chris Debenham <chris.debenham@aus.sun.com>, the LCDproc server
process LCDd now compiles and runs properly on Solaris! Additionally, he has provided a new driver for a 16x2 LCD made by an Australian company. I've compiled and executed this new code on a Solaris 2.6 box, and while I don't have the display the new driver uses, LCDd tries to use it anyway, fails (since the device isn't installed), and continues running, so this looks solid!
This commit is contained in:
@@ -101,7 +101,9 @@ chrono_init ()
|
||||
# endif
|
||||
|
||||
/* Get OS name and version from uname() */
|
||||
if (uname (unamebuf) != 0) {
|
||||
/* Changed to check if eq -1 instead of non-zero */
|
||||
/* since uname may return any non-negative value */
|
||||
if (uname (unamebuf) == -1) {
|
||||
perror ("Error calling uname:");
|
||||
}
|
||||
strcpy (kver, unamebuf->release);
|
||||
|
||||
@@ -27,20 +27,24 @@ get_loadavg (void)
|
||||
int
|
||||
load_init ()
|
||||
{
|
||||
#ifndef SOLARIS
|
||||
if (!loadavg_fd)
|
||||
loadavg_fd = open ("/proc/loadavg", O_RDONLY);
|
||||
|
||||
#endif
|
||||
return 0;
|
||||
}
|
||||
|
||||
int
|
||||
load_close ()
|
||||
{
|
||||
#ifndef SOLARIS
|
||||
if (loadavg_fd)
|
||||
close (loadavg_fd);
|
||||
|
||||
loadavg_fd = 0;
|
||||
|
||||
#endif
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
@@ -15,6 +15,11 @@
|
||||
#include "mode.h"
|
||||
#include "mem.h"
|
||||
|
||||
#ifdef SOLARIS
|
||||
#include <strings.h>
|
||||
#endif
|
||||
|
||||
|
||||
struct meminfo {
|
||||
int total, cache, buffers, free, shared;
|
||||
};
|
||||
@@ -27,7 +32,9 @@ static void
|
||||
get_mem_info (struct meminfo *result)
|
||||
{
|
||||
// int i, res; char *bufptr;
|
||||
int pagesize,page,i;
|
||||
|
||||
#ifndef SOLARIS
|
||||
reread (meminfo_fd, "get_meminfo:");
|
||||
result[0].total = getentry ("MemTotal:", buffer);
|
||||
result[0].free = getentry ("MemFree:", buffer);
|
||||
@@ -36,26 +43,39 @@ get_mem_info (struct meminfo *result)
|
||||
result[0].cache = getentry ("Cached:", buffer);
|
||||
result[1].total = getentry ("SwapTotal:", buffer);
|
||||
result[1].free = getentry ("SwapFree:", buffer);
|
||||
#else
|
||||
result[0].total = 0;
|
||||
result[0].free = 0;
|
||||
result[0].shared = 0;
|
||||
result[0].buffers = 0;
|
||||
result[0].cache = 0;
|
||||
result[1].total = 0;
|
||||
result[1].free = 0;
|
||||
#endif
|
||||
}
|
||||
|
||||
int
|
||||
mem_init ()
|
||||
{
|
||||
#ifndef SOLARIS
|
||||
if (!meminfo_fd) {
|
||||
meminfo_fd = open ("/proc/meminfo", O_RDONLY);
|
||||
}
|
||||
|
||||
#endif
|
||||
return 0;
|
||||
}
|
||||
|
||||
int
|
||||
mem_close ()
|
||||
{
|
||||
#ifndef SOLARIS
|
||||
if (meminfo_fd)
|
||||
meminfo_fd = open ("/proc/meminfo", O_RDONLY);
|
||||
|
||||
meminfo_fd = 0;
|
||||
|
||||
#endif
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
@@ -29,6 +29,10 @@
|
||||
#include "load.h"
|
||||
#include "mem.h"
|
||||
|
||||
#ifdef SOLARIS
|
||||
#include <strings.h>
|
||||
#endif
|
||||
|
||||
int ELLIPSIS = '-';
|
||||
|
||||
// TODO: Clean this up... Support multiple display sizes..
|
||||
|
||||
Reference in New Issue
Block a user