--- old/usr/src/cmd/make/bin/ar.cc	2015-05-22 11:19:39.419619858 -0400
+++ new/usr/src/cmd/make/bin/ar.cc	2015-05-22 11:19:39.443319681 -0400
@@ -199,7 +199,7 @@
 	if (member->body.member.member != NULL) {
 		Wstring member_string(member->body.member.member);
 		wchar_t * wcb = member_string.get_string();
-		if((slash = (wchar_t *) wsrchr(wcb, (int) slash_char)) != NULL) {
+		if((slash = (wchar_t *) wcsrchr(wcb, (int) slash_char)) != NULL) {
 			INIT_STRING_FROM_STACK(true_member_name, buffer);
 			append_string(member->body.member.library->string_mb,
 				      &true_member_name,
@@ -667,9 +667,9 @@
 					goto read_error;
 				}
 				MBSTOWCS(wcs_buffer, arp->arf_5.arf_name);
-				(void) wsncpy(member_string,
+				(void) wcsncpy(member_string,
 					      wcs_buffer,
-					      wslen(wcs_buffer));
+					      wcslen(wcs_buffer));
 				member_string[sizeof(arp->arf_5.arf_name)] =
 								(int) nul_char;
 				member->body.member.member =
--- old/usr/src/cmd/make/bin/doname.cc	2015-05-22 11:19:40.010519915 -0400
+++ new/usr/src/cmd/make/bin/doname.cc	2015-05-22 11:19:40.022882296 -0400
@@ -1488,16 +1488,16 @@
 		/* replace the name with the expansion */
 		if (dependency->name->wildcard) {
 			wcb.init(dependency->name);
-			if ((start = (wchar_t *) wschr(wcb.get_string(),
+			if ((start = (wchar_t *) wcschr(wcb.get_string(),
 					   (int) parenleft_char)) != NULL) {
 				/* lib(*) type pattern */
 				library = buffer;
-				(void) wsncpy(buffer,
+				(void) wcsncpy(buffer,
 					      wcb.get_string(),
 					      start - wcb.get_string());
 				buffer[start-wcb.get_string()] =
 				  (int) nul_char;
-				(void) wsncpy(pattern,
+				(void) wcsncpy(pattern,
 					      start + 1,
 (int) (dependency->name->hash.length-(start-wcb.get_string())-2));
 				pattern[dependency->name->hash.length -
@@ -1505,13 +1505,13 @@
 					  (int) nul_char;
 			} else {
 				library = NULL;
-				(void) wsncpy(pattern,
+				(void) wcsncpy(pattern,
 					      wcb.get_string(),
 					      (int) dependency->name->hash.length);
 				pattern[dependency->name->hash.length] =
 				  (int) nul_char;
 			}
-			start = (wchar_t *) wsrchr(pattern, (int) slash_char);
+			start = (wchar_t *) wcsrchr(pattern, (int) slash_char);
 			if (start == NULL) {
 				directory = dot;
 				p = pattern;
@@ -2700,7 +2700,7 @@
 
 		Wstring wcb(target);
                 if ((link[0] != slash_char) &&
-                    ((p = (wchar_t *) wsrchr(wcb.get_string(), slash_char)) != NULL)) {
+                    ((p = (wchar_t *) wcsrchr(wcb.get_string(), slash_char)) != NULL)) {
                         append_string(wcb.get_string(), &string, p - wcb.get_string() + 1);
 		}
                 append_string(link, &string, result);
@@ -2818,7 +2818,7 @@
 	wchar_t usr_include_sys_buf[MAXPATHLEN];
 
 	register Name		directory = dot;
-	register wchar_t	*p = (wchar_t *) wsrchr(wcb,
+	register wchar_t	*p = (wchar_t *) wcsrchr(wcb,
 							(int) slash_char);
 	register int		length = p - wcb;
 	static Name		usr_include;
@@ -2892,9 +2892,9 @@
 		wcb1.init(conditional->body.conditional.target);
 		pattern = wcb1.get_string();
 		if (pattern[1] != 0) {
-			percent = (wchar_t *) wschr(pattern, (int) percent_char);
+			percent = (wchar_t *) wcschr(pattern, (int) percent_char);
 			if (!wcb.equaln(pattern, percent-pattern) ||
-			    !IS_WEQUAL(wcb.get_string(wcb.length()-wslen(percent+1)), percent+1)) {
+			    !IS_WEQUAL(wcb.get_string(wcb.length()-wcslen(percent+1)), percent+1)) {
 				continue;
 			}
 		}
--- old/usr/src/cmd/make/bin/dosys.cc	2015-05-22 11:19:41.127869073 -0400
+++ new/usr/src/cmd/make/bin/dosys.cc	2015-05-22 11:19:41.139970366 -0400
@@ -107,7 +107,7 @@
 
 	/* Copy string to make it OK to write it. */
 	q = ALLOC_WC(length + 1);
-	(void) wscpy(q, p);
+	(void) wcscpy(q, p);
 	/* Write the state file iff this command uses make. */
 	if (call_make && command_changed) {
 		write_state_file(0, false);
--- old/usr/src/cmd/make/bin/files.cc	2015-05-22 11:19:41.880657822 -0400
+++ new/usr/src/cmd/make/bin/files.cc	2015-05-22 11:19:41.892304221 -0400
@@ -231,7 +231,7 @@
 			*name_p++ = *vpath++;
 		}
 		*name_p++ = (int) slash_char;
-		(void) wscpy(name_p, wcb1.get_string());
+		(void) wcscpy(name_p, wcb1.get_string());
 		alias = GETNAME(file_name, FIND_LENGTH);
 		if (exists(alias) != file_doesnt_exist) {
 			target->stat.is_file = true;
@@ -324,10 +324,10 @@
 	 * files in the directory.
 	 */
 	if ((dir->hash.length > 1) || (wcb.get_string()[0] != (int) period_char)) {
-		(void) wscpy(file_name, wcb.get_string());
+		(void) wcscpy(file_name, wcb.get_string());
 		MBSTOWCS(wcs_buffer, "/");
-		(void) wscat(file_name, wcs_buffer);
-		file_name_p = file_name + wslen(file_name);
+		(void) wcscat(file_name, wcs_buffer);
+		file_name_p = file_name + wcslen(file_name);
 	}
 
 	/* Open the directory. */
@@ -352,7 +352,7 @@
 		 * path supplied to the function.
 		 */
 		MBSTOWCS(tmp_wcs_buffer, dp->d_name);
-		(void) wscpy(file_name_p, tmp_wcs_buffer);
+		(void) wcscpy(file_name_p, tmp_wcs_buffer);
 		file = enter_file_name(file_name, library);
 		if ((pattern != NULL) && amatch(tmp_wcs_buffer, pattern)) {
 			/*
@@ -383,7 +383,7 @@
 	
 			MBSTOWCS(tmp_wcs_buffer, dp->d_name + 2);
 			plain_file_name_p = plain_file_name;
-			(void) wscpy(plain_file_name_p, tmp_wcs_buffer);
+			(void) wcscpy(plain_file_name_p, tmp_wcs_buffer);
 			plain_file = GETNAME(plain_file_name, FIND_LENGTH);
 			plain_file->stat.is_file = true;
 			plain_file->stat.has_sccs = HAS_SCCS;
@@ -436,11 +436,11 @@
  * files in the plain directory. They are also entered in their own right.
  * Prepare the string where we build the true name of the SCCS files.
  */
-	(void) wsncpy(plain_file_name,
+	(void) wcsncpy(plain_file_name,
 		      file_name,
 		      file_name_p - file_name);
 	plain_file_name[file_name_p - file_name] = 0;
-	plain_file_name_p = plain_file_name + wslen(plain_file_name);
+	plain_file_name_p = plain_file_name + wcslen(plain_file_name);
 
         if(!svr4) {
 
@@ -461,14 +461,14 @@
 			(void) sprintf(mb_path, "%s/SCCS", sccs_dir_path);
 		}
 		MBSTOWCS(path, mb_path);
-		(void) wscpy(file_name, path);
+		(void) wcscpy(file_name, path);
 	  } else {
 		MBSTOWCS(wcs_buffer, "SCCS");
-		(void) wscpy(file_name_p, wcs_buffer);
+		(void) wcscpy(file_name_p, wcs_buffer);
 	  }
 	} else {
 		MBSTOWCS(wcs_buffer, ".");
-		(void) wscpy(file_name_p, wcs_buffer);
+		(void) wcscpy(file_name_p, wcs_buffer);
 	}
 	/* Internalize the constructed SCCS dir name. */
 	(void) exists(dir = GETNAME(file_name, FIND_LENGTH));
@@ -482,8 +482,8 @@
 		return result;
 	}
 	MBSTOWCS(wcs_buffer, "/");
-	(void) wscat(file_name, wcs_buffer);
-	file_name_p = file_name + wslen(file_name);
+	(void) wcscat(file_name, wcs_buffer);
+	file_name_p = file_name + wcslen(file_name);
 
 	while ((dp = readdir(dir_fd)) != NULL) {
 		if ((dp->d_fileno == 0) ||
@@ -495,7 +495,7 @@
 		}
 		/* Construct and internalize the true name of the SCCS file. */
 		MBSTOWCS(wcs_buffer, dp->d_name);
-		(void) wscpy(file_name_p, wcs_buffer);
+		(void) wcscpy(file_name_p, wcs_buffer);
 		file = GETNAME(file_name, FIND_LENGTH);
 		file->stat.is_file = true;
 		file->stat.has_sccs = NO_SCCS;
@@ -507,7 +507,7 @@
 		    (dp->d_name[1] == (int) period_char)) {
 	
 			MBSTOWCS(wcs_buffer, dp->d_name + 2);
-			(void) wscpy(plain_file_name_p, wcs_buffer);
+			(void) wcscpy(plain_file_name_p, wcs_buffer);
 			plain_file = GETNAME(plain_file_name, FIND_LENGTH);
 			plain_file->stat.is_file = true;
 			plain_file->stat.has_sccs = HAS_SCCS;
--- old/usr/src/cmd/make/bin/implicit.cc	2015-05-22 11:19:42.340357296 -0400
+++ new/usr/src/cmd/make/bin/implicit.cc	2015-05-22 11:19:42.352542100 -0400
@@ -1146,8 +1146,8 @@
 	if (lmn_target->parenleft) {
 		Wstring lmn_string(lmn_target);
 
-		wchar_t *left = (wchar_t *) wschr(lmn_string.get_string(), (int) parenleft_char);
-		wchar_t *right = (wchar_t *) wschr(lmn_string.get_string(), (int) parenright_char);
+		wchar_t *left = (wchar_t *) wcschr(lmn_string.get_string(), (int) parenleft_char);
+		wchar_t *right = (wchar_t *) wcschr(lmn_string.get_string(), (int) parenright_char);
 
 		if ((left == NULL) || (right == NULL)) {
 			line->body.line.percent = NULL;
--- old/usr/src/cmd/make/bin/macro.cc	2015-05-22 11:19:42.845693454 -0400
+++ new/usr/src/cmd/make/bin/macro.cc	2015-05-22 11:19:42.857267534 -0400
@@ -125,7 +125,7 @@
 		}
 		INIT_STRING_FROM_STACK(value, buffer);		
 		expand_value(p->value, &value, false);
-		if ((length = wslen(value.buffer.start)) >= MAXPATHLEN) {
+		if ((length = wcslen(value.buffer.start)) >= MAXPATHLEN) {
 			mbs = tmp_mbs_buffer = getmem((length + 1) * MB_LEN_MAX);
 			(void) wcstombs(mbs,
 			                value.buffer.start,
--- old/usr/src/cmd/make/bin/main.cc	2015-05-22 11:19:43.254856969 -0400
+++ new/usr/src/cmd/make/bin/main.cc	2015-05-22 11:19:43.267669304 -0400
@@ -1830,13 +1830,13 @@
 	 * of argv[0] for recursive MAKE builds.
 	 */
 	MBSTOWCS(wcs_buffer, "MAKE");
-	def_make_name = GETNAME(wcs_buffer, wslen(wcs_buffer));
+	def_make_name = GETNAME(wcs_buffer, wcslen(wcs_buffer));
 	def_make_macro = get_prop(def_make_name->prop, macro_prop);
 	if ((def_make_macro != NULL) &&
 	    (IS_EQUAL(def_make_macro->body.macro.value->string_mb,
 	              "make"))) {
 		MBSTOWCS(wcs_buffer, argv_zero_string);
-		new_make_value = GETNAME(wcs_buffer, wslen(wcs_buffer));
+		new_make_value = GETNAME(wcs_buffer, wcslen(wcs_buffer));
 		(void) SETVAR(def_make_name,
 		              new_make_value,
 		              false);
@@ -2285,13 +2285,13 @@
 		 * with "POSIX" requirements.
 		 */
 		MBSTOWCS(wcs_buffer, "ARFLAGS");
-		name = GETNAME(wcs_buffer, wslen(wcs_buffer));
+		name = GETNAME(wcs_buffer, wcslen(wcs_buffer));
 		macro = get_prop(name->prop, macro_prop);
 		if ((macro != NULL) && /* Maybe (macro == NULL) || ? */
 		    (IS_EQUAL(macro->body.macro.value->string_mb,
 		              "rv"))) {
 			MBSTOWCS(wcs_buffer, "-rv");
-			value = GETNAME(wcs_buffer, wslen(wcs_buffer));
+			value = GETNAME(wcs_buffer, wcslen(wcs_buffer));
 			(void) SETVAR(name,
 			              value,
 			              false);
@@ -2547,7 +2547,7 @@
 			*cp = (int) nul_char;
 			MBSTOWCS(wcs_buffer, argv[i]);
 			*cp = tmp_char;
-			name = GETNAME(wcs_buffer, wslen(wcs_buffer));
+			name = GETNAME(wcs_buffer, wcslen(wcs_buffer));
 			while (*cp != (int) equal_char) {
 				cp++;
 			}
@@ -2657,7 +2657,7 @@
 			MBSTOWCS(wcs_buffer, *environment);
 			name = wcs_buffer;
 		}
-		value = (wchar_t *) wschr(name, (int) equal_char);
+		value = (wchar_t *) wcschr(name, (int) equal_char);
 
 		/*
 		 * Looks like there's a bug in the system, but sometimes
@@ -2667,11 +2667,11 @@
 			continue;
 		}
 		MBSTOWCS(wcs_buffer2, "SHELL=");
-		if (IS_WEQUALN(name, wcs_buffer2, wslen(wcs_buffer2))) {
+		if (IS_WEQUALN(name, wcs_buffer2, wcslen(wcs_buffer2))) {
 			continue;
 		}
 		MBSTOWCS(wcs_buffer2, "MAKEFLAGS=");
-		if (IS_WEQUALN(name, wcs_buffer2, wslen(wcs_buffer2))) {
+		if (IS_WEQUALN(name, wcs_buffer2, wcslen(wcs_buffer2))) {
 			report_pwd = true;
 			/*
 			 * In POSIX mode we do not want MAKEFLAGS to be readonly.
@@ -2694,7 +2694,7 @@
 		 * directory's .make.state and clobbering them.
 		 */
 		MBSTOWCS(wcs_buffer2, "SUNPRO_DEPENDENCIES");
-		if (IS_WEQUALN(name, wcs_buffer2, wslen(wcs_buffer2))) {
+		if (IS_WEQUALN(name, wcs_buffer2, wcslen(wcs_buffer2))) {
 			continue;
 		}
 
@@ -2811,7 +2811,7 @@
 				//default_target_to_build = GETNAME(wcs_buffer,
 				//				  FIND_LENGTH);
 				default_target_to_build = normalize_name(wcs_buffer,
-								  wslen(wcs_buffer));
+								  wcslen(wcs_buffer));
 				if (default_target_to_build == wait_name) {
 					if (parallel_process_cnt > 0) {
 						finish_running();
@@ -2880,7 +2880,7 @@
 					continue;
 				}
 			MBSTOWCS(wcs_buffer, cp);
-			default_target_to_build = normalize_name(wcs_buffer, wslen(wcs_buffer));
+			default_target_to_build = normalize_name(wcs_buffer, wcslen(wcs_buffer));
 			top_level_target = get_wstring(default_target_to_build->string_mb);
 			report_recursion(default_target_to_build);
 			commands_done = false;
--- old/usr/src/cmd/make/bin/misc.cc	2015-05-22 11:19:43.886043979 -0400
+++ new/usr/src/cmd/make/bin/misc.cc	2015-05-22 11:19:43.897878375 -0400
@@ -497,7 +497,7 @@
 			if ((p->colons != no_colon) &&
 			    ((wcb[0] != (int) period_char) ||
 			     ((wcb[0] == (int) period_char) &&
-			      (wschr(wcb, (int) slash_char))))) {
+			      (wcschr(wcb, (int) slash_char))))) {
 				print_target_n_deps(p);
 			}
 	}
--- old/usr/src/cmd/make/bin/nse_printdep.cc	2015-05-22 11:19:44.416667572 -0400
+++ new/usr/src/cmd/make/bin/nse_printdep.cc	2015-05-22 11:19:44.428436230 -0400
@@ -360,7 +360,7 @@
 		/* 
 		 * if found,  print starting with the space after the ':'
 		 */
-		colon = (wchar_t *) wschr(rp->oldline, (int) colon_char);
+		colon = (wchar_t *) wcschr(rp->oldline, (int) colon_char);
 		(void) printf("%s", colon + 1);
 	}
 }
--- old/usr/src/cmd/make/bin/pmake.cc	2015-05-22 11:19:44.901670158 -0400
+++ new/usr/src/cmd/make/bin/pmake.cc	2015-05-22 11:19:44.913156973 -0400
@@ -190,7 +190,7 @@
 	uname(&uts_info);
 	strcpy(local_host_mb, &uts_info.nodename[0]);
 	MBSTOWCS(local_host, local_host_mb);
-	local_host_wslen = wslen(local_host);
+	local_host_wslen = wcslen(local_host);
 
 	// There is no getdomainname() function on Solaris.
 	// And netname2host() function does not work on Linux.
@@ -198,7 +198,7 @@
 	if (host2netname(mbs_buffer, NULL, NULL) &&
 	    netname2host(mbs_buffer, mbs_buffer2, MAXNETNAMELEN+1)) {
 		MBSTOWCS(full_host, mbs_buffer2);
-		full_host_wslen = wslen(full_host);
+		full_host_wslen = wcslen(full_host);
 	}
 
 	for (ms = make_machines_list;
@@ -237,7 +237,7 @@
 			 * 1) hostname is longer than MAX_HOSTNAMELEN, or
 			 * 2) hostname is unknown
 			 */
-			if ((wslen(mp) > MAX_HOSTNAMELEN) ||
+			if ((wcslen(mp) > MAX_HOSTNAMELEN) ||
 			    ((hp = gethostbyname(mbs_buffer)) == NULL)) {
 				warning(gettext("Ignoring unknown host %s"),
 					mbs_buffer);
@@ -248,7 +248,7 @@
 				}
 			} else {
 				/* Compare current hostname with local_host. */
-				if (wslen(mp) == local_host_wslen &&
+				if (wcslen(mp) == local_host_wslen &&
 				    IS_WEQUALN(mp, local_host, local_host_wslen)) {
 					/*
 					 * Bingo, local_host is in .make.machines.
@@ -256,7 +256,7 @@
 					 */
 					pmake_max_jobs = PMAKE_DEF_MAX_JOBS;
 				/* Compare current hostname with full_host. */
-				} else if (wslen(mp) == full_host_wslen &&
+				} else if (wcslen(mp) == full_host_wslen &&
 					   IS_WEQUALN(mp, full_host, full_host_wslen)) {
 					/*
 					 * Bingo, full_host is in .make.machines.
--- old/usr/src/cmd/make/bin/read.cc	2015-05-22 11:19:45.377730348 -0400
+++ new/usr/src/cmd/make/bin/read.cc	2015-05-22 11:19:45.391496590 -0400
@@ -351,7 +351,7 @@
 		  stdin_text_p = getmem(length = 1024);
 		stdin_buffer_end = stdin_text_p + length;
 		MBSTOWCS(wcs_buffer, "standard input");
-		file_being_read = (wchar_t *) wsdup(wcs_buffer);
+		file_being_read = (wchar_t *) wcsdup(wcs_buffer);
 		line_number = 0;
 		while ((n = read(fileno(stdin),
 				 stdin_text_p,
@@ -827,7 +827,7 @@
 						      &include_name,
 						      true_makefile_name->hash.length);
 
-					wchar_t *slash = wsrchr(include_name.buffer.start, (int) slash_char);
+					wchar_t *slash = wcsrchr(include_name.buffer.start, (int) slash_char);
 					if (slash != NULL) {
 						include_name.text.p = slash + 1;
 						append_string(name_start,
--- old/usr/src/cmd/make/bin/read2.cc	2015-05-22 11:19:46.224482490 -0400
+++ new/usr/src/cmd/make/bin/read2.cc	2015-05-22 11:19:46.236834348 -0400
@@ -111,9 +111,9 @@
 	 * Check if there are any ( or [ that are not prefixed with $.
 	 * If there are, we have to deal with the lib.a(members) format.
 	 */
-	for (cp = (wchar_t *) wschr(string_start, (int) parenleft_char);
+	for (cp = (wchar_t *) wcschr(string_start, (int) parenleft_char);
 	     cp != NULL;
-	     cp = (wchar_t *) wschr(cp + 1, (int) parenleft_char)) {
+	     cp = (wchar_t *) wcschr(cp + 1, (int) parenleft_char)) {
 		if (*(cp - 1) != (int) dollar_char) {
 			*string_end = ch;
 			return enter_member_name(string_start,
@@ -216,7 +216,7 @@
 	}
 	/* Move the library name to the buffer where we intend to build the */
 	/* "lib.a(member)" for each member */
-	(void) wsncpy(buffer, lib_start, member_start - lib_start);
+	(void) wcsncpy(buffer, lib_start, member_start - lib_start);
 	memberp = buffer + (member_start-lib_start);
 	while (1) {
 		long_member_name = NULL;
@@ -245,7 +245,7 @@
 		/* Internalize the member name */
 		member = GETNAME(memberp, cq - memberp);
 		*cq = 0;
-		if ((q = (wchar_t *) wsrchr(memberp, (int) slash_char)) == NULL) {
+		if ((q = (wchar_t *) wcsrchr(memberp, (int) slash_char)) == NULL) {
 			q = memberp;
 		}
 		if ((cq - q > (int) ar_member_name_len) &&
@@ -397,7 +397,7 @@
 	current_component =
 	  cdp =
 	    string =
-	      ALLOC_WC((length = wslen(name_string)) + 1);
+	      ALLOC_WC((length = wcslen(name_string)) + 1);
 	while (length > 0) {
 		if (((length > 3) &&
 		     (name_string[0] == (int) slash_char) &&
@@ -658,7 +658,7 @@
 	if ((makefile_type == reading_makefile) &&
 	    (default_target_to_build == NULL) &&
 	    ((wcb[0] != (int) period_char) ||
-	     wschr(wcb, (int) slash_char))) {
+	     wcschr(wcb, (int) slash_char))) {
 
 /* BID 1181577: $(EMPTY_MACRO) + $(EMPTY_MACRO):
 ** The target with empty name cannot be default_target_to_build
@@ -747,7 +747,7 @@
 				line->body.line.command_template_redefined =
 				  true;
 				if ((wcb[0] == (int) period_char) &&
-				    !wschr(wcb, (int) slash_char)) {
+				    !wcschr(wcb, (int) slash_char)) {
 					line->body.line.command_template =
 					  command;
 				}
@@ -756,7 +756,7 @@
 			}
 		} else {
 			if ((wcb[0] == (int) period_char) &&
-			    !wschr(wcb, (int) slash_char)) {
+			    !wcschr(wcb, (int) slash_char)) {
 				line->body.line.command_template = command;
 			}
 		}
@@ -947,7 +947,7 @@
 	Wstring wcb(target);
 	cp = wcb.get_string();
 	while (true) {
-		cp = (wchar_t *) wschr(cp, (int) percent_char);
+		cp = (wchar_t *) wcschr(cp, (int) percent_char);
 		if (cp != NULL) {
 			result->patterns_total++;
 			cp++;
@@ -964,7 +964,7 @@
 	cp = wcb.get_string();
 	pattern = 0;
 	while (true) {
-		cp1 = (wchar_t *) wschr(cp, (int) percent_char);
+		cp1 = (wchar_t *) wcschr(cp, (int) percent_char);
 		if (cp1 != NULL) {
 			result->patterns[pattern] = GETNAME(cp, cp1 - cp);
 			cp = cp1 + 1;
@@ -998,7 +998,7 @@
 				wcb1.init(depe->name);
 				cp = wcb1.get_string();
 				while (true) {
-					cp = (wchar_t *) wschr(cp, (int) percent_char);
+					cp = (wchar_t *) wcschr(cp, (int) percent_char);
 					if (cp != NULL) {
 						depe->patterns_total++;
 						cp++;
@@ -1015,7 +1015,7 @@
 				cp = wcb1.get_string();
 				pattern = 0;
 				while (true) {
-					cp1 = (wchar_t *) wschr(cp, (int) percent_char);
+					cp1 = (wchar_t *) wcschr(cp, (int) percent_char);
 					if (cp1 != NULL) {
 						depe->patterns[pattern] = GETNAME(cp, cp1 - cp);
 						cp = cp1 + 1;
@@ -1568,12 +1568,12 @@
 
 	/* Check if the path is already relative. */
 	if (to[0] != (int) slash_char) {
-		(void) wscpy(result, to);
+		(void) wcscpy(result, to);
 		return;
 	}
 
 	MBSTOWCS(wcs_buffer, get_current_path());
-	from = allocated = (wchar_t *) wsdup(wcs_buffer);
+	from = allocated = (wchar_t *) wcsdup(wcs_buffer);
 
 	/*
 	 * Find the number of components in the from name.
@@ -1608,7 +1608,7 @@
 	if (*from == (int) nul_char) {
 		if (*to == (int) nul_char) {
 			MBSTOWCS(wcs_buffer, ".");
-			(void) wscpy(result, wcs_buffer);
+			(void) wcscpy(result, wcs_buffer);
 			retmem(allocated);
 			return;
 		}
@@ -1623,15 +1623,15 @@
 	/* Add on the ".."s. */
 	for (i = 0; i < ncomps; i++) {
 		MBSTOWCS(wcs_buffer, "../");
-		(void) wscat(result, wcs_buffer);
+		(void) wcscat(result, wcs_buffer);
 	}
 
 	/* Add on the remainder of the to name, if any. */
 	if (*tocomp == (int) nul_char) {
-		len = wslen(result);
+		len = wcslen(result);
 		result[len - 1] = (int) nul_char;
 	} else {
-		(void) wscat(result, tocomp);
+		(void) wcscat(result, tocomp);
 	}
 	retmem(allocated);
 	return;
@@ -1806,7 +1806,7 @@
 	Wstring nms((*name));
 	wchar_t * wcb = nms.get_string();
 
-	colon = (wchar_t *) wsrchr(wcb, (int) colon_char);
+	colon = (wchar_t *) wcsrchr(wcb, (int) colon_char);
 	if ((colon != NULL) && (IS_WEQUAL(colon, colon_sh) || IS_WEQUAL(colon, colon_shell))) {
 		INIT_STRING_FROM_STACK(destination, buffer);
 
--- old/usr/src/cmd/make/bin/rep.cc	2015-05-22 11:19:47.081147899 -0400
+++ new/usr/src/cmd/make/bin/rep.cc	2015-05-22 11:19:47.093094105 -0400
@@ -101,12 +101,12 @@
 	Wstring rns(recursive_name);
 	wchar_t * wcb = rns.get_string();
 	while (fgetws(line, line_size, fp) != NULL) {
-		while (wslen(line) == line_index) {
-			if (line[wslen(line) - 1] == '\n') {
+		while (wcslen(line) == line_index) {
+			if (line[wcslen(line) - 1] == '\n') {
 				continue;
 			}
 			bigger_line = ALLOC_WC(2 * line_size);
-			wscpy(bigger_line, line);
+			wcscpy(bigger_line, line);
 			retmem(line);
 			line = bigger_line;
 			if (fgetws(&line[line_index], line_size, fp) == NULL)
@@ -115,12 +115,12 @@
 			line_size = 2 * line_size;
 		}
 
-		colon = (wchar_t *) wschr(line, (int) colon_char);
+		colon = (wchar_t *) wcschr(line, (int) colon_char);
 		if (colon == NULL) {
 			continue;
 		}
-		dollar = (wchar_t *) wschr(line, (int) dollar_char);
-		line[wslen(line) - 1] = (int) nul_char;
+		dollar = (wchar_t *) wcschr(line, (int) dollar_char);
+		line[wcslen(line) - 1] = (int) nul_char;
 		if (IS_WEQUALN(&colon[2], wcb,
 	            (int) recursive_name->hash.length)) {
 			/*
@@ -136,16 +136,16 @@
 			/*
 			 * set conditional_macro_string if string is present
 			 */
-			rp->oldline = (wchar_t *) wsdup(line);
+			rp->oldline = (wchar_t *) wcsdup(line);
 			if ( dollar != NULL ){
 				rp->cond_macrostring = 
-				    (wchar_t *) wsdup(dollar - VER_LEN + 1);
+				    (wchar_t *) wcsdup(dollar - VER_LEN + 1);
 			}
 			/* 
 			 * get target name into recursive struct
 			 */
 			*colon = (int) nul_char;
-			rp->target = (wchar_t *) wsdup(line);
+			rp->target = (wchar_t *) wcsdup(line);
 			*bpatch = rp;
 			bpatch = &rp->next;
 		}
@@ -183,14 +183,14 @@
 		(void) memset((char *) rp, 0, sizeof (Recursive_make_rec));
 		wchar_t * wcb = get_wstring(target->string_mb); // XXX Tolik: needs retmem
                 rp->target = wcb;
-		rp->newline = (wchar_t *) wsdup(line);
-		rp->cond_macrostring = (wchar_t *) wsdup(rec_buf);
+		rp->newline = (wchar_t *) wcsdup(line);
+		rp->cond_macrostring = (wchar_t *) wcsdup(rec_buf);
 		*bpatch = rp;
 		bpatch = &rp->next;
 		changed = true;
 	} else {
 		if ((rp->oldline != NULL) && !IS_WEQUAL(rp->oldline, line)) {
-			rp->newline = (wchar_t *) wsdup(line);
+			rp->newline = (wchar_t *) wcsdup(line);
 			changed = true;
 		}
 		rp->removed = false;
--- old/usr/src/cmd/make/include/mksh/defs.h	2015-05-22 11:19:47.777841706 -0400
+++ new/usr/src/cmd/make/include/mksh/defs.h	2015-05-22 11:19:47.789590646 -0400
@@ -36,8 +36,6 @@
 #include <errno.h>		/* errno */
 
 #include <wctype.h>
-#include <widec.h>
-
 
 /*
  * A type and some utilities for boolean values
@@ -158,8 +156,8 @@
 #define GETNAME(a,b)		getname_fn((a), (b), false)
 #define IS_EQUAL(a,b)		(!strcmp((a), (b)))
 #define IS_EQUALN(a,b,n)	(!strncmp((a), (b), (n)))
-#define IS_WEQUAL(a,b)		(!wscmp((a), (b)))
-#define IS_WEQUALN(a,b,n)	(!wsncmp((a), (b), (n)))
+#define IS_WEQUAL(a,b)		(!wcscmp((a), (b)))
+#define IS_WEQUALN(a,b,n)	(!wcsncmp((a), (b), (n)))
 #define MBLEN(a)		mblen((a), MB_LEN_MAX)
 #define MBSTOWCS(a,b)		(void) mbstowcs_with_check((a), (b), MAXPATHLEN)
 #define	MBTOWC(a,b)		mbtowc((a), (b), MB_LEN_MAX)
@@ -244,7 +242,7 @@
 		void init(struct _Name * name);
 		void init(wchar_t * name, unsigned length);
 		unsigned length() {
-			return wslen(string.buffer.start);
+			return wcslen(string.buffer.start);
 		};
 		void append_to_str(struct _String * str, unsigned off, unsigned length);
 
--- old/usr/src/cmd/make/lib/mksh/dosys.cc	2015-05-22 11:19:48.263981915 -0400
+++ new/usr/src/cmd/make/lib/mksh/dosys.cc	2015-05-22 11:19:48.276763048 -0400
@@ -179,7 +179,7 @@
 	}
 	argv[argv_index++] = shellname;
 	argv[argv_index++] = (char*)(ignore_error ? "-c" : "-ce");
-	if ((length = wslen(command)) >= MAXPATHLEN) {
+	if ((length = wcslen(command)) >= MAXPATHLEN) {
 		tmp_mbs_buffer = getmem((length * MB_LEN_MAX) + 1);
                 (void) wcstombs(tmp_mbs_buffer, command, (length * MB_LEN_MAX) + 1);
 		cmd_argv_index = argv_index;
@@ -342,7 +342,7 @@
 	 * In fact, doing it may cause the sh command to fail!
 	 */
 	p = &argv[1];
-	if ((length = wslen(command)) >= MAXPATHLEN) {
+	if ((length = wcslen(command)) >= MAXPATHLEN) {
 		tmp_mbs_buffer = getmem((length * MB_LEN_MAX) + 1);
 		(void) wcstombs(tmp_mbs_buffer, command, (length * MB_LEN_MAX) + 1);
 		argv[0] = strdup(tmp_mbs_buffer);
@@ -373,7 +373,7 @@
 		if (*t) {
 			for (*t++ = (int) nul_char; iswspace(*t); t++);
 		}
-		if ((length = wslen(q)) >= MAXPATHLEN) {
+		if ((length = wcslen(q)) >= MAXPATHLEN) {
 			tmp_mbs_buffer = getmem((length * MB_LEN_MAX) + 1);
 			(void) wcstombs(tmp_mbs_buffer, q, (length * MB_LEN_MAX) + 1);
 			*p++ = strdup(tmp_mbs_buffer);
--- old/usr/src/cmd/make/lib/mksh/i18n.cc	2015-05-22 11:19:48.727616276 -0400
+++ new/usr/src/cmd/make/lib/mksh/i18n.cc	2015-05-22 11:19:48.739040978 -0400
@@ -77,7 +77,7 @@
 {
 	wchar_t		*char_sem_char;
 
-	char_sem_char = (wchar_t *) wschr(char_semantics_char, ch);
+	char_sem_char = (wchar_t *) wcschr(char_semantics_char, ch);
 	if (char_sem_char == NULL) {
 		/*
 		 * Return the integer entry for the last slot,
--- old/usr/src/cmd/make/lib/mksh/macro.cc	2015-05-22 11:19:49.317465998 -0400
+++ new/usr/src/cmd/make/lib/mksh/macro.cc	2015-05-22 11:19:49.330235785 -0400
@@ -39,7 +39,6 @@
 #include <mksh/misc.h>		/* retmem() */
 #include <mksh/read.h>		/* get_next_block_fn() */
 
-#include <widec.h>
 #include <libintl.h>
 
 /*
@@ -155,7 +154,7 @@
 	value->being_expanded = true;
 	/* Setup the structure we read from */
 	Wstring vals(value);
-	sourceb.string.text.p = sourceb.string.buffer.start = wsdup(vals.get_string());
+	sourceb.string.text.p = sourceb.string.buffer.start = wcsdup(vals.get_string());
 	sourceb.string.free_after_use = true;
 	sourceb.string.text.end =
 	  sourceb.string.buffer.end =
@@ -459,10 +458,10 @@
 		}
 		/* Internalize the macro name using the first char only. */
 		name = GETNAME(string.buffer.start, 1);
-		(void) wscpy(string.buffer.start, string.buffer.start + 2);
+		(void) wcscpy(string.buffer.start, string.buffer.start + 2);
 	}
 	/* Check for other kinds of translations. */
-	if ((colon = (wchar_t *) wschr(string.buffer.start,
+	if ((colon = (wchar_t *) wcschr(string.buffer.start,
 				       (int) colon_char)) != NULL) {
 		/*
 		 * We have a $(FOO:.c=.o) type translation.
@@ -476,10 +475,10 @@
 		if (IS_WEQUAL(colon, colon_sh) || IS_WEQUAL(colon, colon_shell)) {
 			replacement = sh_replace;
 		} else if ((svr4) ||
-		           ((percent = (wchar_t *) wschr(colon + 1,
+		           ((percent = (wchar_t *) wcschr(colon + 1,
 							 (int) percent_char)) == NULL)) {
 			while (colon != NULL) {
-				if ((eq = (wchar_t *) wschr(colon + 1,
+				if ((eq = (wchar_t *) wcschr(colon + 1,
 							    (int) equal_char)) == NULL) {
 					fatal_reader_mksh(gettext("= missing from replacement macro reference"));
 				}
@@ -488,19 +487,19 @@
 					retmem(left_tail);
 				}
 				left_tail = ALLOC_WC(left_tail_len + 1);
-				(void) wsncpy(left_tail,
+				(void) wcsncpy(left_tail,
 					      colon + 1,
 					      eq - colon - 1);
 				left_tail[eq - colon - 1] = (int) nul_char;
 				replacement = suffix_replace;
-				if ((colon = (wchar_t *) wschr(eq + 1,
+				if ((colon = (wchar_t *) wcschr(eq + 1,
 							       (int) colon_char)) != NULL) {
 					tmp_len = colon - eq;
 					if(right_tail) {
 						retmem(right_tail);
 					}
 					right_tail = ALLOC_WC(tmp_len);
-					(void) wsncpy(right_tail,
+					(void) wcsncpy(right_tail,
 						      eq + 1,
 						      colon - eq - 1);
 					right_tail[colon - eq - 1] =
@@ -509,16 +508,16 @@
 					if(right_tail) {
 						retmem(right_tail);
 					}
-					right_tail = ALLOC_WC(wslen(eq) + 1);
-					(void) wscpy(right_tail, eq + 1);
+					right_tail = ALLOC_WC(wcslen(eq) + 1);
+					(void) wcscpy(right_tail, eq + 1);
 				}
 			}
 		} else {
-			if ((eq = (wchar_t *) wschr(colon + 1,
+			if ((eq = (wchar_t *) wcschr(colon + 1,
 						    (int) equal_char)) == NULL) {
 				fatal_reader_mksh(gettext("= missing from replacement macro reference"));
 			}
-			if ((percent = (wchar_t *) wschr(colon + 1,
+			if ((percent = (wchar_t *) wcschr(colon + 1,
 							 (int) percent_char)) == NULL) {
 				fatal_reader_mksh(gettext("%% missing from replacement macro reference"));
 			}
@@ -532,7 +531,7 @@
 					retmem(left_head);
 				}
 				left_head = ALLOC_WC(tmp_len);
-				(void) wsncpy(left_head,
+				(void) wcsncpy(left_head,
 					      colon + 1,
 					      percent - colon - 1);
 				left_head[percent-colon-1] = (int) nul_char;
@@ -548,7 +547,7 @@
 					retmem(left_tail);
 				}
 				left_tail = ALLOC_WC(tmp_len);
-				(void) wsncpy(left_tail,
+				(void) wcsncpy(left_tail,
 					      percent + 1,
 					      eq - percent - 1);
 				left_tail[eq-percent-1] = (int) nul_char;
@@ -558,17 +557,17 @@
 				left_tail_len = 0;
 			}
 
-			if ((percent = (wchar_t *) wschr(++eq,
+			if ((percent = (wchar_t *) wcschr(++eq,
 							 (int) percent_char)) == NULL) {
 
-				right_hand[0] = ALLOC_WC(wslen(eq) + 1);
+				right_hand[0] = ALLOC_WC(wcslen(eq) + 1);
 				right_hand[1] = NULL;
-				(void) wscpy(right_hand[0], eq);
+				(void) wcscpy(right_hand[0], eq);
 			} else {
 				i = 0;
 				do {
 					right_hand[i] = ALLOC_WC(percent-eq+1);
-					(void) wsncpy(right_hand[i],
+					(void) wcsncpy(right_hand[i],
 						      eq,
 						      percent - eq);
 					right_hand[i][percent-eq] =
@@ -579,14 +578,14 @@
 					eq = percent + 1;
 					if (eq[0] == (int) nul_char) {
 						MBSTOWCS(wcs_buffer, "");
-						right_hand[i] = (wchar_t *) wsdup(wcs_buffer);
+						right_hand[i] = (wchar_t *) wcsdup(wcs_buffer);
 						i++;
 						break;
 					}
-				} while ((percent = (wchar_t *) wschr(eq, (int) percent_char)) != NULL);
+				} while ((percent = (wchar_t *) wcschr(eq, (int) percent_char)) != NULL);
 				if (eq[0] != (int) nul_char) {
-					right_hand[i] = ALLOC_WC(wslen(eq) + 1);
-					(void) wscpy(right_hand[i], eq);
+					right_hand[i] = ALLOC_WC(wcslen(eq) + 1);
+					(void) wcscpy(right_hand[i], eq);
 					i++;
 				}
 				right_hand[i] = NULL;
@@ -696,7 +695,7 @@
 					chr = *p;
 					*p = (int) nul_char;
 				}
-				eq = (wchar_t *) wsrchr(block_start, (int) slash_char);
+				eq = (wchar_t *) wcsrchr(block_start, (int) slash_char);
 				if (p != NULL) {
 					*p = chr;
 				}
@@ -718,7 +717,7 @@
 					chr = *p;
 					*p = (int) nul_char;
 				}
-				eq = (wchar_t *) wsrchr(block_start, (int) slash_char);
+				eq = (wchar_t *) wcsrchr(block_start, (int) slash_char);
 				if (p != NULL) {
 					*p = chr;
 				}
@@ -919,13 +918,13 @@
 		}
 		while (fgets(mb_buf, sizeof(mb_buf), pipe) != NULL) {
 			MBSTOWCS(wcs_buffer, mb_buf);
-			append_string(wcs_buffer, &result_string, wslen(wcs_buffer));
+			append_string(wcs_buffer, &result_string, wcslen(wcs_buffer));
 		}
 		if (pclose(pipe) != 0) {
 			fatal_mksh(gettext("Execute of %s failed"), mach_command);
 		}
 
-		value = GETNAME(result_string.buffer.start, wslen(result_string.buffer.start));
+		value = GETNAME(result_string.buffer.start, wcslen(result_string.buffer.start));
 
 		if (set_host) {
 			(void) setvar_daemon(host_arch, value, false, no_daemon, true, 0);
@@ -974,13 +973,13 @@
 		}
 		while (fgets(mb_buf, sizeof(mb_buf), pipe) != NULL) {
 			MBSTOWCS(wcs_buffer, mb_buf);
-			append_string(wcs_buffer, &result_string, wslen(wcs_buffer));
+			append_string(wcs_buffer, &result_string, wcslen(wcs_buffer));
 		}
 		if (pclose(pipe) != 0) {
 			fatal_mksh(gettext("Execute of %s failed"), arch_command);
 		}
 
-		value = GETNAME(result_string.buffer.start, wslen(result_string.buffer.start));
+		value = GETNAME(result_string.buffer.start, wcslen(result_string.buffer.start));
 
 		if (set_host) {
 			(void) setvar_daemon(host_mach, value, false, no_daemon, true, 0);
@@ -1298,24 +1297,24 @@
 		wchar_t * wcb_vr = vr_str.get_string();
 
 		length = 32 +
-		  wslen(wcb_ha) +
-		    wslen(wcb_ta) +
-		      wslen(wcb_vr);
+		  wcslen(wcb_ha) +
+		    wcslen(wcb_ta) +
+		      wcslen(wcb_vr);
 		old_vr = wcb_vr;
 		MBSTOWCS(wcs_buffer, "/usr/arch/");
 		if (IS_WEQUALN(old_vr,
 			       wcs_buffer,
-			       wslen(wcs_buffer))) {
-			old_vr = (wchar_t *) wschr(old_vr, (int) colon_char) + 1;
+			       wcslen(wcs_buffer))) {
+			old_vr = (wchar_t *) wcschr(old_vr, (int) colon_char) + 1;
 		}
-		if ( (ha == ta) || (wslen(wcb_ta) == 0) ) {
+		if ( (ha == ta) || (wcslen(wcb_ta) == 0) ) {
 			new_value = old_vr;
 		} else {
 			new_value = ALLOC_WC(length);
 			new_value_allocated = true;
 			WCSTOMBS(mbs_buffer, old_vr);
-			(void) wsprintf(new_value,
-				        "/usr/arch/%s/%s:%s",
+			(void) swprintf(new_value, length * SIZEOFWCHAR_T, 
+				        L"/usr/arch/%s/%s:%s",
 				        ha->string_mb + 1,
 				        ta->string_mb + 1,
 				        mbs_buffer);
--- old/usr/src/cmd/make/lib/mksh/misc.cc	2015-05-22 11:19:49.867217526 -0400
+++ new/usr/src/cmd/make/lib/mksh/misc.cc	2015-05-22 11:19:49.879144148 -0400
@@ -170,7 +170,7 @@
 	 * If the len argument is -1 we count the chars here.
 	 */
 	if (len == FIND_LENGTH) {
-		length = wslen(name);
+		length = wcslen(name);
 	} else {
 		length = len;
 	}
@@ -681,7 +681,7 @@
 append_string(register wchar_t *from, register String to, register int length)
 {
 	if (length == FIND_LENGTH) {
-		length = wslen(from);
+		length = wcslen(from);
 	}
 	if (to->buffer.start == NULL) {
 		expand_string(to, 32 + length);
@@ -692,7 +692,7 @@
 			      length);
 	}
 	if (length > 0) {
-		(void) wsncpy(to->text.p, from, length);
+		(void) wcsncpy(to->text.p, from, length);
 		to->text.p += length;
 	}
 	*(to->text.p) = (int) nul_char;
@@ -767,7 +767,7 @@
 	 */
 	expandstring_count++;
 	p = ALLOC_WC(length);
-	(void) wscpy(p, string->buffer.start);
+	(void) wcscpy(p, string->buffer.start);
 	string->text.p = p + (string->text.p - string->buffer.start);
 	string->text.end = p + (string->text.end - string->buffer.start);
 	string->buffer.end = p + length;
