Sponsored Content
Full Discussion: Memset fails on Solaris
Homework and Emergencies Emergency UNIX and Linux Support Memset fails on Solaris Post 302921430 by skyineyes on Friday 17th of October 2014 01:56:21 AM
Old 10-17-2014
Memset fails on Solaris

Hi,

memset call is failing on solaris for me. I wrote below code and that also fails. Any hints?

Code:
 void *memset(void *dst, int c, size_t n)
 {
     if (n) {
         char *d = dst;

         do {
             *d++ = c;
         } while (--n);
     }
     return dst;
 }

 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Solaris 2.6 exec login fails

Ladies and Gentlemen; I need your help in determining what has happened to one of my companies systems. Here is the scenario: System Ultra 5 with Solaris 2.6 and the latest patch cluster installed. Third party security person "hardened" the system yesterday.... (2 Replies)
Discussion started by: rambo15
2 Replies

2. Programming

about memset fuction

Dear all, In my code,i am planning to use memset function to re-initialise an array before populating it everytime. Will using memset function be an overload to the program? (3 Replies)
Discussion started by: ranj@chn
3 Replies

3. UNIX for Dummies Questions & Answers

pkgadd fails when installing Solaris 8 patches

Hi, guys ! I usually run this task without even thinking on outcome, because it never failed. But this time when I tried installation of patches for Solaris 8 OS on my old machine, I received this message: "pkgadd: ERROR: no packages were found in </var/spool/pkg>" I compared the contents... (5 Replies)
Discussion started by: Deicide5997
5 Replies

4. UNIX for Dummies Questions & Answers

questions in memset

HI all , please find the piece of code below char *t; char *f; char buf; memset(buf,0,50); after that i am assigning memory for (i=0; i<100; i++) { t = buf+(i*6); f = "ARUN"; } my question .. 1) i have run this it is... (7 Replies)
Discussion started by: arunkumar_mca
7 Replies

5. UNIX for Advanced & Expert Users

memset vs calloc

Dear Friends, Can any one tell me the difference between memset and calloc function in C. Regards, Selvi (7 Replies)
Discussion started by: salvi
7 Replies

6. Solaris

ldap client fails to start under solaris 10

I have an issue here with ldap client. It stoped and won't start. What I have got: sadm $ tail /var/adm/messages Apr 16 09:17:24 hostname inetd: libsldap: Status: 2 Mesg: Unable to load configuration '/var/ldap/ldap_client_file' (''). Apr 16 09:17:24 hostname inetd: libsldap: Status: 2 ... (3 Replies)
Discussion started by: aixlover
3 Replies

7. Solaris

Solaris 10 install fails on sparc

I'm trying to do an upgrade/install from Solaris 8 to Solaris 10 on a SUN Sparc system. I halt the system, as documented, but when I attempt to boot off the distribution DVD; i.e. halt : : OK> boot cdrom The system indicates that the device is 'unrecognizable' These are SUN... (5 Replies)
Discussion started by: imagtek
5 Replies

8. Programming

C bzero() to memset() issue

Hi guys, my tool works fine in gentoo, ubuntu now im trying to port it to windows but bzero/bcopy I read aren't working on windows and for better portability I should of use memset() so im trying to translate bzero(buffer,256);in printf("MAIL TO"); strcpy(buffer, rcp); ... (4 Replies)
Discussion started by: Jess83
4 Replies

9. Solaris

Solaris: clnt_create fails on solaris x86

Hi, I am facing an issue with Solaris x86 machine Machine Details: uname -a SunOS sol10-64 5.10 Generic_137138-09 i86pc i386 i86pc .............................. Description: I am trying to register a programm with proramm ID 300760 with version number 1, and tryint to create a... (0 Replies)
Discussion started by: DivakarAdari
0 Replies

10. Shell Programming and Scripting

awk works on Linux but fails on Solaris

On linux i have the below command working fine. awk '/<app-deploy>/{A=1;++i} /<\/app-deploy>/{print >> "found"i".tmp";A=0} A{;print >> "found"i".tmp"}' deploy.xml But the same is failing on Solaris Output: awk: syntax error near line 1 awk: bailing out near line 1 uname -a SunOS mymac 5.10... (5 Replies)
Discussion started by: mohtashims
5 Replies
strcpy(9F)						   Kernel Functions for Drivers 						strcpy(9F)

NAME
strcpy, strlcat, strlcpy, strncat, strncpy, strspn - String operations. SYNOPSIS
#include <sys/ddi.h> char *strcpy(char *dst, const char *src); size_t strlcat(char *dst, const char *src, size_t dstsize); size_t strlcpy(char *dst, const char *src, size_t dstsize); char *strncat(char *restrict s1, const char *restrict s2, size_t n); char *strncpy(char *dst, const char *src, size_t n); size_t strspn(const char *s1, const char *s2); INTERFACE LEVEL
Solaris DDI specific (Solaris DDI). PARAMETERS
dst, src Pointers to character strings. s1, s2 Pointers to character strings. n Count of characters to be copied. DESCRIPTION
The arguments dst, src, s1 and s2 point to strings. The strcpy(), strlcpy(), strncpy(), strlcat() and strncat() functions all alter their first argument. These functions do not check for overflow of the array pointed to by the first argument. strcpy() The strcpy() function copies characters in the string src to dst, terminating at the first null character in src, and returns dst to the caller. No bounds checking is done. strncpy() The strncpy() function copies src to dst, null-padding or truncating at n bytes, and returns dst. No bounds checking is done. strlcpy() The strlcpy() function copies a maximum of dstsize-1 characters (where dstsize represents the size of the string buffer dst) from src to dst, truncating src if necessary. The result is always null-terminated. The function returns strlen(src). Buffer overflow can be checked as follows: if (strlcpy(dst, src, dstsize) >= dstsize) return (-1); strncat() The strncat() function appends a maximum of n characters. The initial character of s2 overrides the null character at the end of s1. strlcat() The strlcat() function appends a maximum of (dstsize- strlen(dst)-1) characters of src to dst (where dstsize represents the size of the string buffer dst). If the string pointed to by dst contains a null-terminated string that fits into dstsize bytes when strlcat() is called, the string pointed to by dst is a null-terminated string that fits in dstsize bytes (including the terminating null character) when it completes, and the initial character of src overrides the null character at the end of dst. If the string pointed to by dst is longer than dstsize bytes when strlcat() is called, the string pointed to by dst is not changed. The function returns min{dst- size,strlen(dst)}+strlen(src). Buffer overflow can be checked as follows: if (strlcat(dst, src, dstsize) >= dstsize) return -1; strspn() The strspn() function returns the length of the initial segment of string s1 that consists entirely of characters from string s2. RETURN VALUES
strcpy(), strncat() and strncpy() return dst. For strlcat(), strlcpy() and strspn(), see the Description section. CONTEXT
These functions can be called from user or interrupt context. SEE ALSO
strlen(9F), strcmp(9F), bcopy(9F), ddi_copyin(9F) Writing Device Drivers SunOS 5.10 7 Sep 2004 strcpy(9F)
All times are GMT -4. The time now is 09:10 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy