ViewVC Help
View File | Revision Log | Show Annotations | Revision Graph | Root Listing
root/i-scream/projects/libstatgrab/src/libstatgrab/tools.c
(Generate patch)

Comparing projects/libstatgrab/src/libstatgrab/tools.c (file contents):
Revision 1.62 by ats, Sun Nov 7 12:34:24 2004 UTC vs.
Revision 1.63 by tdb, Sat Sep 24 13:29:23 2005 UTC

# Line 64 | Line 64
64   #include <sys/fcntl.h>
65   #include <dirent.h>
66   #endif
67 + #ifdef WIN32
68 + #include "win32.h"
69 + #endif
70  
71   #if defined(SOLARIS) && defined(HAVE_LIBDEVINFO_H)
72   struct map{
# Line 444 | Line 447 | int sg_update_string(char **dest, const char *src) {
447          return 0;
448   }
449  
450 + /* join two strings together */
451 + int sg_concat_string(char **dest, const char *src) {
452 +        char *new;
453 +        int len = strlen(*dest) + strlen(src) + 1;
454 +
455 +        new = sg_realloc(*dest, len);
456 +        if (new == NULL) {
457 +                return -1;
458 +        }
459 +
460 +        *dest = new;
461 +        strcat(*dest, src);
462 +        return 0;
463 + }
464 +
465   #if (defined(FREEBSD) && !defined(FREEBSD5)) || defined(DFBSD)
466   kvm_t *sg_get_kvm() {
467          static kvm_t *kvmd = NULL;
# Line 531 | Line 549 | int sg_init(){
549          build_mapping();
550   #endif
551   #endif
552 + #ifdef WIN32
553 +        return sg_win32_start_capture();
554 + #endif
555          return 0;
556   }
557  
558 + int sg_shutdown() {
559 + #ifdef WIN32
560 +        sg_win32_end_capture();
561 + #endif
562 +        return 0;
563 + }
564 +
565 + int sg_snapshot() {
566 + #ifdef WIN32
567 +        return sg_win32_snapshot();
568 + #else
569 +        return 0;
570 + #endif
571 + }
572 +
573   int sg_drop_privileges() {
574 + #ifndef WIN32
575   #ifdef HAVE_SETEGID
576          if (setegid(getgid()) != 0) {
577   #elif defined(HAVE_SETRESGID)
# Line 555 | Line 592 | int sg_drop_privileges() {
592                  sg_set_error_with_errno(SG_ERROR_SETEUID, NULL);
593                  return -1;
594          }
595 + #endif /* WIN32 */
596          return 0;
597   }
598  

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines