zsh-workers
 help / color / mirror / code / Atom feed
* RLIMIT, HP-UX B.10.20
@ 1996-08-19 18:43 Rudy Anderson
  1996-08-22 20:39 ` Zoltan Hidvegi
  0 siblings, 1 reply; 2+ messages in thread
From: Rudy Anderson @ 1996-08-19 18:43 UTC (permalink / raw)
  To: zsh-workers

[-- Attachment #1: Type: text/plain, Size: 445 bytes --]

Howdy, here ya go:

cc -Aa -D_HPUX_SOURCE -c -I.. -I. -I.  -DHAVE_CONFIG_H -O builtin.c
cpp: "builtin.c", line 3639: error 4062: there are some unknown limits.  Fix me!

CPU=HP 9000/715-75 (hppa1.1)
OS=HP-UX B.10.20

I'm using the HP (ansi) compiler, ran the regular 'config.' This worked fine
under HP-UX 10.10...

Let me know if you need any further info.

Thanx!

-- 
Rudy Anderson
HP-UX Systems Support
rudy@foghorn.rose.hp.com
916.785.1352

[-- Attachment #2: resource.h --]
[-- Type: text/plain, Size: 5545 bytes --]

/* $Header: resource.h,v 1.15.98.11 96/05/03 12:40:17 ukrishna Exp $ 
 * $Locker: BERT $
 */

#ifndef _SYS_RESOURCE_INCLUDED
#define _SYS_RESOURCE_INCLUDED

#ifdef _KERNEL_BUILD
#include "../h/stdsyms.h"
#else /* ! _KERNEL_BUILD */
#include <sys/stdsyms.h>
#endif /* _KERNEL_BUILD */

#ifdef _INCLUDE_XOPEN_SOURCE_EXTENDED

#ifdef _KERNEL_BUILD
#include "../h/types.h"
#include "../h/time.h"
#else /* ! _KERNEL_BUILD */
#include <sys/types.h>
#include <sys/time.h>
#endif /* _KERNEL_BUILD */

/*
 * Resource limits
 */

#if !defined(_KERNEL)

#  define __rlimit rlimit
#  include <sys/_rlimit_body.h>
#  undef __rlimit

#  if defined(_LARGEFILE64_SOURCE)

#    define __rlimit  rlimit64
#    define rlim_t rlim64_t
#    include <sys/_rlimit_body.h>
#    undef rlim_t
#    undef __rlimit

#  endif /* _LARGEFILE64_SOURCE */

#else /* _KERNEL */

#  define __rlimit  rlimit64
#  define rlim_t rlim64_t
#  include "_rlimit_body.h"
#  undef rlim_t
#  undef __rlimit

#  define __rlimit  rlimit32
#  define rlim_t rlim32_t
#  include "_rlimit_body.h"
#  undef rlim_t
#  undef __rlimit

#  define __rlimit  k_rlimit
#  define rlim_t  k_rlim_t
#  include "_rlimit_body.h"
#  undef rlim_t
#  undef __rlimit

#endif /* ! _KERNEL */

/*
 * Process priority specifications to get/setpriority.
 */

#define	PRIO_MIN	-20
#define	PRIO_MAX	20

#define	PRIO_PROCESS	0
#define	PRIO_PGRP	1
#define	PRIO_USER	2

/*
 * Resource utilization information.
 */

#define	RUSAGE_SELF	0
#define	RUSAGE_CHILDREN	-1

struct	rusage {
	struct timeval ru_utime;	/* user time used */
	struct timeval ru_stime;	/* system time used */
					/* actual values kept in proc struct */
	long	ru_maxrss;
#define	ru_first	ru_ixrss
	long	ru_ixrss;		/* integral shared memory size */
	long	ru_idrss;		/* integral unshared data " */
	long	ru_isrss;		/* integral unshared stack " */
	long	ru_minflt;		/* page reclaims */
	long	ru_majflt;		/* page faults */
	long	ru_nswap;		/* swaps */
	long	ru_inblock;		/* block input operations */
	long	ru_oublock;		/* block output operations */
	long	ru_ioch;		/* # of characters read/written */
	long	ru_msgsnd;		/* messages sent */
	long	ru_msgrcv;		/* messages received */
	long	ru_nsignals;		/* signals received */
	long	ru_nvcsw;		/* voluntary context switches */
	long	ru_nivcsw;		/* involuntary " */
#define	ru_last		ru_nivcsw
};

/*
 * Within the kernel, time information is stored as ticks rather than as
 * seconds plus microseconds.  This makes normal updates more efficient
 * and eliminates race conditions while updating.  The seconds field is
 * used to store ticks and the microseconds field is unused.
 */

/*
 * The information is converted to seconds plus microseconds when given
 * to the user via the getrusage and wait3 system calls.
 */


/* Function prototypes */

#ifndef _KERNEL
#ifdef __cplusplus
   extern "C" {
#endif /* __cplusplus */

#ifdef _PROTOTYPES
   extern int getpriority(int, id_t);
   extern int getrusage(int, struct rusage *);
   extern int setpriority(int, id_t, int);
# ifndef _FILE64
   extern int getrlimit(int, struct rlimit *);
   extern int setrlimit(int, const struct rlimit *);
# else
   static int getrlimit(int, struct rlimit *);
   static int setrlimit(int, const struct rlimit *);
# endif
# if defined(_LARGEFILE64_SOURCE)
   extern int getrlimit64(int, struct rlimit64 *);
   extern int setrlimit64(int, const struct rlimit64 *);
# endif
#else /* not _PROTOTYPES */
   extern int getpriority();
   extern int getrusage();
   extern int setpriority();
   extern int getrlimit();
   extern int setrlimit();
# if defined(_LARGEFILE64_SOURCE)
    extern int getrlimit64();
    extern int setrlimit64();
# endif
#endif /* not _PROTOTYPES */

#if defined(_FILE64)
static getrlimit(a,b) struct rlimit *b;    { return __getrlimit64(a,b); }
# ifdef __STDC_EXT__
static setrlimit(a,b) const struct rlimit *b;  { return __setrlimit64(a,b); }
# else
static setrlimit(a,b) struct rlimit *b;  { return __setrlimit64(a,b); }
# endif
#endif

#ifdef __cplusplus
   }
#endif /* __cplusplus */
#endif /* not _KERNEL */

/*
 * Resource limits
 */

#if defined(_KERNEL) || defined(_LARGEFILE64_SOURCE)
#  define  RLIM64_INFINITY  0x7fffffffffffffffLL
#  define  RLIM32_INFINITY  0x7fffffff
#endif

#if defined(_KERNEL)
#  define  K_RLIM_INFINITY  RLIM64_INFINITY
#  define  ATT_BYTESPERBLOCK	512
#  define  LOG_ATT_BYTESPERBLOCK	9
/* bytes to 1/2k blocks and 1/2k  blocks to bytes conversion macro. */
#  define bt2bk(x) 	(((unsigned) (x)) >> (LOG_ATT_BYTESPERBLOCK)) 
#  define bk2bt(x) 	(((unsigned) (x)) << (LOG_ATT_BYTESPERBLOCK))
#  define ULIMIT_MAX	bt2bk(0x80000000)
#else
# if defined(_FILE64) 
#   define  RLIM_INFINITY   0x7fffffffffffffffLL
# else
#   define  RLIM_INFINITY   0x7fffffff
# endif /* _FILE64 */
#endif /* _KERNEL */

#define	RLIMIT_CPU	0		/* cpu time in milliseconds */
#define	RLIMIT_DATA	2		/* data size */
#define	RLIMIT_STACK	3		/* stack size */
#define	RLIMIT_RSS	5		/* resident set size */

#define	RLIMIT_FSIZE	1		/* maximum file size */
#define	RLIMIT_CORE	4		/* core file size */
#define RLIMIT_NOFILE   6               /* maximum number of open files */
#define RLIMIT_OPEN_MAX RLIMIT_NOFILE   /* maximum number of open files */
#define RLIMIT_AS       7               /* maximum number of open files */
#define RLIMIT_TCACHE   8		/* maximum number of cached threads */
#define	RLIM_NLIMITS	9		/* number of resource limits */

#endif /* _INCLUDE_XOPEN_SOURCE_EXTENDED */

#endif /* _SYS_RESOURCE_INCLUDED */

/* markd - No 3/14 code to merge. */
/*       - No 3/24 code to merge. */

^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: RLIMIT, HP-UX B.10.20
  1996-08-19 18:43 RLIMIT, HP-UX B.10.20 Rudy Anderson
@ 1996-08-22 20:39 ` Zoltan Hidvegi
  0 siblings, 0 replies; 2+ messages in thread
From: Zoltan Hidvegi @ 1996-08-22 20:39 UTC (permalink / raw)
  To: Rudy Anderson; +Cc: zsh-workers

> Howdy, here ya go:
> 
> cc -Aa -D_HPUX_SOURCE -c -I.. -I. -I.  -DHAVE_CONFIG_H -O builtin.c
> cpp: "builtin.c", line 3639: error 4062: there are some unknown limits.  Fix me!
> 
> CPU=HP 9000/715-75 (hppa1.1)
> OS=HP-UX B.10.20
> 
> I'm using the HP (ansi) compiler, ran the regular 'config.' This worked fine
> under HP-UX 10.10...

The patch below should make it work.  Does the ulimit on HP-UX 10.20 has
some option to set this limit?  We may add this new option to zsh's ulimit
as well (now you must use limit cachedthreads to set it).

Zoltan


*** Src/builtin.c	1996/08/14 15:25:29	2.77
--- Src/builtin.c	1996/08/22 20:34:41
***************
*** 3638,3643 ****
--- 3638,3651 ----
  # if NEXT_RLIM != RLIM_NLIMITS
     #error there are some unknown limits.  Fix me!
  # endif
+ # if defined RLIMIT_TCACHE && RLIMIT_TCACHE == NEXT_RLIM
+ #  undef NEXT_RLIM
+ #  define NEXT_RLIM (RLIMIT_TCACHE + 1)
+     "cachedthreads",
+ # endif /* RLIMIT_TCACHE */
+ # if NEXT_RLIM != RLIM_NLIMITS
+    #error there are some unknown limits.  Fix me!
+ # endif
  # undef NEXT_RLIM
      NULL
  };
***************
*** 4142,4147 ****
--- 4150,4161 ----
  	    limit /= 1024;
  	break;
  # endif /* RLIMIT_AS */
+ # ifdef RLIMIT_TCACHE
+     case RLIMIT_TCACHE:
+ 	if (head)
+ 	    printf("cached threads             ");
+ 	break;
+ # endif /* RLIMIT_TCACHE */
      }
      /* display the limit */
      if (limit == RLIM_INFINITY)


^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~1996-08-22 20:43 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
1996-08-19 18:43 RLIMIT, HP-UX B.10.20 Rudy Anderson
1996-08-22 20:39 ` Zoltan Hidvegi

Code repositories for project(s) associated with this public inbox

	https://git.vuxu.org/mirror/zsh/

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).